502 Bad Gateway nginx/1.10.3 (Ubuntu)
Hi!
Things happen. Today i can’t go inside my wordpress site. Trying to aply some correction found in similar questions, nginx responded in my Putty:
nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed (13: Permission denied) 2019/03/13 19:35:09 [warn] 9418#9418: the “user” directive makes sense only if t he master process runs with super-user privileges, ignored in /etc/nginx/nginx.c onf:1 2019/03/13 19:35:09 [emerg] 9418#9418: BIO_new_file(“/etc/letsencrypt/live/arun. com.br/fullchain.pem”) failed (SSL: error:0200100D:system library:fopen:Permissi on denied:fopen(‘/etc/letsencrypt/live/arun.com.br/fullchain.pem’,‘r’) error:200 6D002:BIO routines:BIO_new_file:system lib) nginx: configuration file /etc/nginx/nginx.conf test failed
Well, i need help to fix this, a step to step guidance.
Thanks a lot.
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!
Greetings!
It sounds like something significant occurred on the server, to which I may not know the right answer without knowing what it was that occurred. I admit that I find it odd that restarting services worked, while this error is in the logs:
denied:fopen('/etc/letsencrypt/live/arun.com.br/fullchain.pem','r') error:200 6D002:BIO
Regardless, I can only reconcile the two by ignoring that error and moving on to the website loading after restarting the services, so I will go ahead and move on to that point.
After everything is back up you noticed that you cannot edit anything in wp-admin, and that you receive a 502 Bad Gateway error when attempting to. In this case, I would have you run this over SSH:
tail -f /var/log/nginx/error.log
Then, while that remains open, go into your wp-admin and try to make a change so that the 502 error occurs. Look back to the SSH window, an error should appear in that log at the same time. What does it say? The answer to that is the path to the resolution.
Jarland
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.