server {
listen 80;
listen [::]:80;
server_name api.salonmlsarajevo.com;
return 301 https://api.salonmlsarajevo.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/salonmlsarajevo.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/salonmlsarajevo.com/privkey.pem;
server_name api.salonmlsarajevo.com;
root /var/www/SalonML_API/;
index index.html;
autoindex off;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
}
}