首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
拉勾
V2EX  ›  NGINX

为啥这个反向代理不成功?

  •  
  •   jsjcjsjc · 72 天前 · 808 次点击
    这是一个创建于 72 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    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 "";
                    }
    }
    
    4 回复  |  直到 2019-01-08 20:43:18 +08:00
        1
    qwefdrt   71 天前 via iPhone   ♥ 1
    proxy_pass http://jsjcjsjc.asuscomm.com:50000;
    域名加端口?
        2
    Honwhy   71 天前   ♥ 1
    查看一下 access_log,是不是替换后的 URL 不合法呢
        3
    jsjcjsjc   71 天前
    @Honwhy 这个错误,看不明白啊
    2019/01/08 07:25:40 [error] 19114#0: *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#0: *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/"
        4
    jsjcjsjc   71 天前
    @qwefdrt 貌似还是不行~~
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2329 人在线   最高记录 4385   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.3 · 16ms · UTC 15:39 · PVG 23:39 · LAX 08:39 · JFK 11:39
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1