By xevioni
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.
nginx -t
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
cat nginx.conf
cat /sites-available/xeviondev
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
The Nginx config looks correct. Can you confirm if your AAAA record actually matches the IPv6 that you have assigned on your server?
Also what I could suggest is:
tail -100 /var/log/nginx/error.log
This should give you some more information for further troubleshooting.
Let me know how it goes.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.