I've got a personal website running up and going. I've rented a cloud ssd server and configured nginx on it to serve content. All the content which has to be served directly is in the path "/www/public" .
So here comes the issue: when i go to https://www.danielecencig.com I get redirected to the index page (right now you'd see the maintenance but that's correct). While when I go to http://www.danielecencig.com it stays on NGINX welcome page. Where was i wrong in my config?
server {
listen 80;
listen 443 default_server ssl;
ssl_certificate /etc/nginx/ssl/1_www.danielecencig.com_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/ssl.key;
server_name www.danielecencig.com;
root /www/public;
rewrite ^/$ /index.html permanent;
location / {
root /www/public;
if (-f $document_root/error/maintenance.html) {
return 503;
}
try_files $uri $uri/ $uri.html =404;
}
location /SienaBikes {
if (-f $document_root/error/maintenance.html) {
return 503;
}
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 503 /error/maintenance.html;
location ^~ /error/ {
internal;
root /www/public;
}
}