My domain is: yokyu.com
I ran this command: sudo certbot --nginx
It produced this output: Successful in generating the certificate
My web server is (include version): nginx 1.18
The operating system my web server runs on is (include version): Ubunti 22
My hosting provider, if applicable, is:
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.31
My problem is that after running the certbot I cannot access the site via https or http. Was possible via http before. Have tried to make changes, according to different post I have found. But nothing helps.
Following is what I have right now:
server {
root /var/www/html;
index index.php;
server_name yokyu.com www.yokyu.com;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/yokyu.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/yokyu.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.yokyu.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = yokyu.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
server_name yokyu.com www.yokyu.com;
return 404; # managed by Certbot
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
}
If someone have an idea what I have done wrong and could point me in the right direction, that would be super!
Thanks and be safe!