阿里云反向代理 国外反向到国内被屏蔽 ~ Error 502 Bad Gateway

备案被取消,先暂时将域名指向国外服务器,国外服务器进行反向代理指向国内IP和特定端口(非80 443),一开始访问正常,过了一段时间,访问量大,已经无法访问了。

测试三台服务器

1)在国外的代理服务器上进行测试返回:

[root@bandwagon vhost]# curl -I http://120.*.*.*:8083;
curl: (56) Recv failure: Connection reset by peer
[root@bandwagon vhost]# telnet 120.*.*.* 8083
Trying 120.*.*.*...
Connected to 120.*.*.*.
Escape character is '^]'.
Connection closed by foreign host.
[root@bandwagon vhost]#

nginx access日志信息

2019/02/27 21:38:34 [error] 3167#3167: *571918 recv() failed (104: Connection reset by peer) 
while reading response header from upstream, client: 203.133.*.*, server: ****.com, 
request: "GET /xxx/126961.html HTTP/1.1", 
upstream: "http://120.*.*.*:8083/xxxx/126961.html", host: "www.***.com"

2)在国外另外一台服务器测试
返回和下面的一样

3)在国内的另外一台服务器上测试返回:

[root@bk ~]# telnet 120.*.*.* 8083
Trying 120.*.*.* ...
Connected to 120.*.*.* .
Escape character is '^]'.
^CConnection closed by foreign host.
[root@bk ~]# curl -I http://120.*.*.*:8083
HTTP/1.1 200 OK
Server: nginx/1.10.2
Date: Thu, 28 Feb 2019 02:36:40 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/7.1.11
Set-Cookie: PHPSESSID=abdb1208996a49597ad4d7e9f701353a; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: _csrf=68f245efc4ef613b9bc5af67852066e38e9f71f9fc7cdr3ac711a3ac299a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22ieGgJoOBK0BvtvWJttY-Cdw85SWU1V43%22%3B%7D; path=/; HttpOnly
[root@bk ~]#

前几天又可以了,现在今天又不行了,极度不稳定。
猜测:可以肯定的绝对是阿里云防火墙把这台经常链接的服务器的IP给屏蔽了,因为固定端口

你可能感兴趣的:(反向代理,nginx)