Question

Problem: "502 Bad Gateway nginx/1.10.3 (Ubuntu)"

Hi, after the NYC3 Droplet Reboot 2018-02-22 17:00 UTC [Spectre and Meltdown Mitigation] my site is down and I get “502 Bad Gateway nginx/1.10.3 (Ubuntu)”. I found these nginx’s error logs:

2018/02/22 22:35:04 [error] 1571#1571: *448 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/running.txt HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/running.txt", host: "45.55.205.197" 
2018/02/22 22:35:04 [error] 1571#1571: *449 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/remote_addr.php?hostname=adsp-xv-us-nyc HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/remote_addr.php?hostname=adsp-xv-us-nyc", host: "45.55.205.197" 
2018/02/22 22:35:38 [error] 1571#1571: *452 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.81.62, server: strangerthancinema.it, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "strangerthancinema.it" 
2018/02/22 22:36:04 [error] 1571#1571: *454 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/running.txt HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/running.txt", host: "45.55.205.197" 
2018/02/22 22:36:20 [error] 1571#1571: *456 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.81.60, server: strangerthancinema.it, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "strangerthancinema.it" 
2018/02/22 22:37:04 [error] 1571#1571: *458 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/running.txt HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/running.txt", host: "45.55.205.197" 
2018/02/22 22:38:04 [error] 1571#1571: *462 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/running.txt HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/running.txt", host: "45.55.205.197" 
2018/02/22 22:38:37 [error] 1571#1571: *466 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.93.94, server: strangerthancinema.it, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "strangerthancinema.it" 
2018/02/22 22:38:43 [error] 1571#1571: *468 connect() failed (111: Connection refused) while connecting to upstream, client: 151.50.140.189, server: 45.55.205.197, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:2368/", host: "45.55.205.197" 
2018/02/22 22:38:44 [error] 1571#1571: *468 connect() failed (111: Connection refused) while connecting to upstream, client: 151.50.140.189, server: 45.55.205.197, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "45.55.205.197", referrer: "http://45.55.205.197/" 
2018/02/22 22:39:00 [error] 1571#1571: *474 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.81.33, server: strangerthancinema.it, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:2368/favicon.ico", host: "strangerthancinema.it" 
2018/02/22 22:39:04 [error] 1571#1571: *476 connect() failed (111: Connection refused) while connecting to upstream, client: 104.131.85.203, server: 45.55.205.197, request: "GET /api371878927a/running.txt HTTP/1.0", upstream: "http://127.0.0.1:2368/api371878927a/running.txt", host: "45.55.205.197" 

How do I resolve this problem ? Thanks


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

cd /path/to/webroot to change your directory to the webroot

ls -la will print out the info you need

Depending if you have NGINX running as www-data or nginx as the user:group you may need to update

chown -R www-data:www-data /path/to./webroot

Ensure your webroot has the correct ownership and permissions

As well nginx -t will let you know of any errors in your NGINX configuration file(s) if any are present.

Izinkan