技术解析

为啥这个反向代理不成功?
0
2021-05-19 22:10:20
idczone

其他我照这写的都没问题啊~~就这个不行~~ 感谢感谢

server
        {
                listen 80;
                server_name therouter.320.io;


                if ($http_user_agent ~* (baiduspider|360spider|haosouspider|googlebot|soso|bing大带宽服务器|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) {
                return  403;
                }

                location / {
                sub_filter jsjcjsjc.asuscomm.com:50000 therouter.320.io;
                sub_filter_once off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Referer http://jsjcjsjc.asuscomm.com:50000;
                proxy_set_header Host jsjcjsjc.asuscomm.com:50000;
                proxy_pass http://jsjcjsjc.asuscomm.com:50000;
                proxy_set_header Accept-Encoding "";
                }
}

proxy_pass http://jsjcjsjc.asuscomm.com:50000;
域名加端口?

查看一下 access_log,是不是替换后的 URL 不合法呢

这个错误,看不明白啊
2019/01/08 07:25:40 [error] 19114*4 upstream timed out (110: Connection timed out) while connecting to upstream, client: 180.117.33.151, server: therouter.320.io, request: "GET / HTTP/1.1", upstream: "http://180.117.33.151:50000/", host: "therouter.320.io"
2019/01/08 07:26:33 [error] 19114*2 upstream timed out (110: Connection timed out) while connecting to upstream, client: 180.117.33.151, server: therouter.320.io, request: "GET /favicon.ico HTTP/1.1", upstream: "http://180.117.33.151:50000/favicon.ico", host: "therouter.320.io", referrer: "http://therouter.320.io/"

貌似还是不行~~

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服