如何修复nginx 502坏网关错误?

时间:2018-03-26 03:17:46

标签: nginx

几个星期前我已经设置了一个nginx服务器,当时502 bad gateway运行良好。

但是,当我今天在浏览器中重新检查时,它会返回sudo tail -30 /var/log/nginx/error.log错误。

以下是2018/03/26 10:13:12 [error] 9456#9456: *2580202 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /?season=1&league_id=1'%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))oUvL)%20AND%20'kSYX'='kSYX&match_day=1&team_id=1 HTTP/1.0", upstream: "http://127.0.0.1:3000/?season=1&league_id=1'%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))oUvL)%20AND%20'kSYX'='kSYX&match_day=1&team_id=1", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580204 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "POST /wp-admin/admin-ajax.php?action=duplicator_package_delete HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php?action=duplicator_package_delete", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580206 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date&order=asc HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date&order=asc", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580208 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.163, server: _, request: "GET /?action=data_management&cpmvc_do_action=mvparse&f=datafeed&method=remove&rruleType=del_only&calendarId=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))nDnr) HTTP/1.0", upstream: "http://127.0.0.1:3000/?action=data_management&cpmvc_do_action=mvparse&f=datafeed&method=remove&rruleType=del_only&calendarId=1%20AND%20(SELECT%20*%20FROM%20(SELECT(SLEEP(5)))nDnr)", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580210 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin-ajax.php HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580212 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580214 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "POST /wp-admin/admin-ajax.php?action=duplicator_package_delete HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin-ajax.php?action=duplicator_package_delete", host: "180.76.117.109:80" 2018/03/26 10:13:12 [error] 9456#9456: *2580216 connect() failed (111: Connection refused) while connecting to upstream, client: 180.97.106.39, server: _, request: "GET /wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date%2c(select%20*%20from%20(select(sleep(5)))a)&order=asc HTTP/1.0", upstream: "http://127.0.0.1:3000/wp-admin/admin.php?page=wpseo_bulk-editor&type=title&orderby=post_date%2c(select%20*%20from%20(select(sleep(5)))a)&order=asc", host: "180.76.117.109:80" 2018/03/26 10:48:39 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 10:48:39 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 10:48:51 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 10:48:51 [error] 9456#9456: *2580218 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 10:51:22 [error] 9456#9456: *2580223 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 10:51:22 [error] 9456#9456: *2580223 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:07:58 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:07:58 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:07:59 [error] 9456#9456: *2580226 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:08:18 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:08:18 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:08:19 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:08:19 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:08:20 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:08:20 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:08:30 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:08:30 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 2018/03/26 11:08:31 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /1/ HTTP/1.1", upstream: "http://127.0.0.1:3000/1/", host: "180.76.117.109" 2018/03/26 11:08:32 [error] 5593#5593: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 175.169.4.93, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "180.76.117.109", referrer: "http://180.76.117.109/1/" 的结果:

george

有谁知道可能是什么问题?

1 个答案:

答案 0 :(得分:0)

检查上游服务器,即" http://180.76.117.109:3000/"。它很可能会下降。