My domain is: jonsson.am www.jonsson.am
I ran this command: jonsson.am
It produced this output: ERR_TOO_MANY_REDIRECTS
My web server is (include version): nginx version: nginx/1.18.0
The operating system my web server runs on is (include version): Debian GNU/Linux 11
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): certbot 1.12.0
I have installed nginx, certbot. The only things (to my knowledge) that I have done to differ from an unmodified install is:
mkdir /var/www/jonsson
echo "<h1>Hello World!</h1>" > /var/www/jonsson/index.html
echo "server {
listen 80 ;
listen [::]:80 ;
root /var/www/jonsson;
index index.html index.htm ;
server_name jonsson.am www.jonsson.am;
location / {
try_files $uri $uri/ =404;
}
}" > /etc/nginx/sites-available/jonsson
ln -s /etc/nginx/sites-available/jonsson /etc/nginx/sites-enabled/jonsson
systemctl reload nginx
certbot --nginx
# default settings
systemctl reload nginx
I'd be grateful if you could offer some help. At present the server file (after certbot is finished with it) looks like this
server {
root /var/www/jonsson;
index index.html index.htm ;
server_name jonsson.am www.jonsson.am;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/jonsson.am/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jonsson.am/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.jonsson.am) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = jonsson.am) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name jonsson.am www.jonsson.am;
return 404; # managed by Certbot
}
Please let me know if I should provide the DNS-records or anything else. It's the first time I try certbot; would be pleased if I could learn to use it for all projects.