I have a http website (with Flask and nginx) which is up and running. I'm trying to install ssl with certbot
and following their steps leads to a successful installation message (congratulations...) but refreshing my webpage leads to 404 Not Found nginx/1.18.0 (Ubuntu)
.
This is the nginx.conf
file after sudo certbot --nginx
server {
server_name www.mydomain.com;
location /static {
alias /home/ubuntu/adviser/flaskblog/static;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.mydomain.com;
return 404; # managed by Certbot
}
any help is really appreciated.