Internal Server Error when i try to access my ip

October 30, 2019 192 views
Nginx

I am new to cloud hosting but i have been able to launch my django project which works well however i woke to the surprise that my ip address no longer works, it just shows 404 Not Found nginx/1.14.0 (Ubuntu) and the domain linked to the ip now shows internal server error. I have checked my droplet and it seems just fine; i have no clue why this happened. Any help will be appreciated. Thanks

2 Answers

Hello,

I would recommend starting with your Nginx error log first. This would give you more information about what could be wrong. You could check the last 100 lines in your error log with the following command:

tail -100 /var/log/nginx/error.log

If you are unsure, you could share the errors here and I could try to advise you further.

Hope that this helps!
Regards,
Bobby

  • Thanks for your reply. It has really been a nightmare. Here is the error log :

     2019/10/30 19:02:30 [error] 23187#23187: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 197.210.57.40, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:03:23 [error] 23187#23187: *1 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 197.210.57.40, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:04:01 [error] 23187#23187: *1 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 197.210.57.40, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:04:18 [alert] 23187#23187: *8 open socket #12 left in connection 4
    2019/10/30 19:04:18 [alert] 23187#23187: aborting
    2019/10/30 19:08:28 [error] 23230#23230: *1 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 197.210.57.248, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:20:52 [error] 23230#23230: *5 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 197.210.57.40, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:25:47 [error] 1056#1056: *5 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 197.210.58.83, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    2019/10/30 19:25:51 [error] 1056#1056: *5 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 197.210.58.83, server: 157.245.250.235, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "157.245.250.235"
    
    edited by MattIPv4
  • I uploaded the error log earlier.

I fixed the 404 page but now i get 502 Bad Gateway, i think it has to do with Active: failed (Result: service-start-limit-hit)

Have another answer? Share your knowledge.