504 Gateway Time-out hosted on Amazon AWS

While trying to entering into the site error is coming . Even the login page is not coming . This application is hosted on Amazon Aws .
Herewith I am attaching the screen shot of the corresponding error .
the bench restart command is also not working .
Can you please suggest me why this is happening ?

@Prashanta_Mahato
please check your logs and share traceback.
-restart all network service
-increase the timeout of your nginx and supervisor service.

Thanks

I have run the following commands:
1. sudo supervisorctl reload
2. sudo service nginx reload

I have also increase the timeout time.Now the sites is open but operations are very slow.

Logs:

ubuntu@ip-172-31-43-254:~/frappe-bench$ tail -f /var/log/nginx/error.log
2017/10/24 05:48:22 [error] 2204#0: *481 connect() failed (111: Connection refused) while connecting to upstream, client: 178.62.34.82, server: erp.nawalorganics.com, request: β€œPOST / HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/”, host: β€œerp.nawalorganics.com”, referrer: β€œhttps://erp.nawalorganics.com/desk”
2017/10/24 05:48:25 [error] 2206#0: *479 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: runga.rungamatteegroup.com, request: β€œGET /desk HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/desk”, host: β€œrunga.rungamatteegroup.com”
2017/10/24 05:48:26 [error] 2206#0: *479 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: runga.rungamatteegroup.com, request: β€œGET /favicon.ico HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/favicon.ico”, host: β€œrunga.rungamatteegroup.com”
2017/10/24 05:48:38 [error] 2204#0: *486 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET /desk HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/desk”, host: β€œerp.nawalorganics.com”, referrer: β€œhttps://erp.nawalorganics.com/login”
2017/10/24 05:48:39 [error] 2204#0: *486 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET /favicon.ico HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/favicon.ico”, host: β€œerp.nawalorganics.com”, referrer: β€œhttps://erp.nawalorganics.com/desk”
2017/10/24 05:48:47 [error] 2206#0: *494 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET /desk HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/desk”, host: β€œerp.nawalorganics.com”
2017/10/24 05:48:49 [error] 2206#0: *494 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET /desk HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/desk”, host: β€œerp.nawalorganics.com”
2017/10/24 05:48:52 [error] 2206#0: *494 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET / HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/”, host: β€œerp.nawalorganics.com”
2017/10/24 05:48:52 [error] 2206#0: *498 connect() failed (111: Connection refused) while connecting to upstream, client: 178.62.34.82, server: erp.nawalorganics.com, request: β€œPOST / HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/”, host: β€œerp.nawalorganics.com”, referrer: β€œhttps://erp.nawalorganics.com/desk”
2017/10/24 05:48:59 [error] 2206#0: *494 connect() failed (111: Connection refused) while connecting to upstream, client: 1.186.97.118, server: erp.nawalorganics.com, request: β€œGET / HTTP/1.1”, upstream: β€œhttp://127.0.0.1:8000/”, host: β€œerp.nawalorganics.com”

1 Like

Browser console logs:

GET https://erp.nawalorganics.com/ [HTTP/1.1 504 Gateway Time-out 121423ms]

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.