Liumang
V2EX  ›  服务器

nginx反向代理后端服务器地址的问题

  •  
  •   Liumang · Jun 29, 2012 · 3486 views
    This topic created in 5147 days ago, the information mentioned may be changed or developed.
    我用nginx搭建了一个反向代理服务器,
    这条语句
    server { listen 80; server_name www.test.com; location / { proxy_pass http://192.168.1.2; }}用test.com重定向到反向代理服务器同一网段内的另一台192.168.2.1的服务器,这样配置可以,但是如果后端服务器地址192.168.2.1改成公网地址,重定向就不行了,求高手解答。
    1 replies    1970-01-01 08:00:00 +08:00
    cute
        1
    cute  
       Jun 29, 2012
    proxy_redirect off;
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2675 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 15:21 · PVG 23:21 · LAX 08:21 · JFK 11:21
    ♥ Do have faith in what you're doing.