NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
jsjcjsjc
V2EX  ›  NGINX

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

  •  
  •   jsjcjsjc · Jan 7, 2019 · 3092 views
    This topic created in 2692 days ago, the information mentioned may be changed or developed.

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

    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 replies    2019-01-08 20:43:18 +08:00
    qwefdrt
        1
    qwefdrt  
       Jan 7, 2019 via iPhone   ❤️ 1
    proxy_pass http://jsjcjsjc.asuscomm.com:50000;
    域名加端口?
    Honwhy
        2
    Honwhy  
       Jan 8, 2019   ❤️ 1
    查看一下 access_log,是不是替换后的 URL 不合法呢
    jsjcjsjc
        3
    jsjcjsjc  
    OP
       Jan 8, 2019
    @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/"
    jsjcjsjc
        4
    jsjcjsjc  
    OP
       Jan 8, 2019
    @qwefdrt 貌似还是不行~~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2960 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:26 · PVG 15:26 · LAX 00:26 · JFK 03:26
    ♥ Do have faith in what you're doing.