Liumang
V2EX  ›  服务器

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

  •  
  •   Liumang · Jun 29, 2012 · 3395 views
    This topic created in 5105 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   ·   799 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 19:18 · PVG 03:18 · LAX 12:18 · JFK 15:18
    ♥ Do have faith in what you're doing.