title: HttpServletRequest redirect with nginx
body: <p>I have an servlet application which is deployed in a private network on port <code>8080</code>, and we use the nginx which can be accessed outside to proxy that:</p>
  
  <p>The proxy machine have two network cards:</p>
  
  <pre><code>192.168.10.12(can be accessed outside)
  10.1.1.2(private,can not be accessed)
  </code></pre>
  
  <p>And the nginx configuration:</p>
  
  <pre><code>server {
      listen       88;
      server_name  192.168.10.12;
      location ~ /server/ {
          proxy_pass   http://10.1.1.2:8080;
      }
  }
  </code></pre>
  
  <p>Everything works well until it meet the <code>redirect</code>, the following response may be send to the client:
      response.sendRedirect("/login");</p>
  
  <p>Then the browser will try to get <code>http://10.1.1.2/login</code>, which can be be accessed.</p>
  
  <p>While I want the browser redirect to <code>http://192.168.10.12:88/login</code>.</p>
  
  <p>Is this possible?</p>