My domain is:www.davidjhindley.com
I ran this command: See below.
It produced this output: See below.
My web server is (include version): 1.10.3-0ubuntu0.16.04.5
The operating system my web server runs on is (include version): Ubuntu 16.04.7
My hosting provider, if applicable, is:Digital Ocean
I can login to a root shell on my machine (yes or no, or I don't know):yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot):1.16.0
I recently tried to use "certbot-auto renew" to renew my certificates and got a message telling me certbot auto would no longer work, so I followed the instructions to install certbot via snapd. The new certificates installed correctly, but I now can't load my website. I think it is something to do with my nginx configuration file. I was getting too many redirects, so I removed the return 301 command under the https server part of my "default" file at \etc\nginx\sites-available, and that removed the redirect errors, but I now just get Error 404 not found errors. When I originally installed certbot a few years ago, I think I manually changed some of the nginx configuration file called \etc\nginx\sites-available\default so maybe the changes made automatically when I updated certbot via snapd are conflicting in some way with those manual changes. The current file called "default" stored in \etc\nginx\sites-available\ is shown below.
Any help you can give would be much appreciated.
Many Thanks
David.
#########################################
server {
server_name davidjhindley.com www.davidjhindley.com;
###next bit removed 12 June 2021 after installing new certbot via snapd as was getting too many redirects
# return 301 https://$server_name$request_uri;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/davidjhindley.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/davidjhindley.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
}
# SSL configuration
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-davidjhindley.com.conf;
include snippets/ssl-params.conf;
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location /shiny/ {
proxy_pass http://127.0.0.1:3838/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
rewrite ^(/shiny/[^/]+)$ $1/ permanent;
}
#next bit added by DH 24 Mar 17 - means can use <<webaddress\rstudio\>>
location /rstudio/ {
proxy_pass http://127.0.0.1:8787/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
#added 24 March for let's encrypt/certbot stuff
location ~ /.well-known {
allow all;
}
}
server {
if ($host = www.davidjhindley.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = davidjhindley.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name davidjhindley.com www.davidjhindley.com;
return 404; # managed by Certbot
}