Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
SSL Certbot Certificate Expired -> Appearance of 502 Gateway Error when trying to renew
Today my site broke as the SSL Certificate expired. The certbot setup was setup to automatically renew, however that did not execute, and manually trying to renew/reinstall the certificate comes back with a 502 Gateway Error for the HTML Verification pages it works through.
Since this may be related to a NGINX Configuration error, here are my nginx files. Feel free to critique what I should change in order to optimize it.
I’ve also included some commands to certify that services are in proper working order, despite the 502 Gateway error.
Thank you for any support you can give.
sudo certbot --nginx -d xevion.dev -d www.xevion.dev
The only thing I can point out is that it’s working on HTTP and not HTTPS, which I can’t seem to find a specific reason for? I don’t remember needing to type in any special arguments to get it to work on HTTPS only. Additionally, I ran it with multiple arguments and some not at all to make sure that it had no effect and that it was using HTTP autonomously. I believe this might be the source of the problem, somehow.
xevion@ubuntu-s-1vcpu-1gb-lon1-01:/var/log$ sudo nginx -t nginx: [warn] conflicting server name "xevion.dev" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "www.xevion.dev" on 0.0.0.0:80, ignored nginx: [warn] conflicting server name "xevion.dev" on [::]:80, ignored nginx: [warn] conflicting server name "www.xevion.dev" on [::]:80, ignored nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
I’m not sure of the fix for the first couple of warns, perhaps they’re for HTTP IPv4 & IPv6, which is completely impossible with the HSTS policy in place. But business as usual, it has always been that way.
systemctl status nginx;systemctl status xeviondev
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×