title: Error with IP and Nginx as reverse proxy
body: <p>I configured my Nginx as simple reverse proxy.</p>
  
  <p>I'm just using basic setting</p>
  
  <pre><code>location / {
      proxy_pass foo.dnsalias.net;
      proxy_pass_header Set-Cookie;
      proxy_pass_header P3P;
  }
  </code></pre>
  
  <p>The problem is that after some time (few days) the site behind nginx become unaccessible. Indead nginx try to call a bad ip (the site behind nginx is at my home behind my box and I'm a using a dyn-dns because my ip is not fixe). This dyn-dns is always valid (I can call my site directly) but for obscure reason Nginx get stuck with that..</p>
  
  <p>So as said, nginx just give me 504 Gateway Time-out after some time. It looks like the error come when my ip change at home.
  Here is a sample of error log:</p>
  
  <pre><code>[error] ... upstream timed out (110: Connection timed out) while connecting to upstream, client: my.current.ip, server: myreverse.server.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://my.old
  .home.ip", host: "myreverse.server.com"
  </code></pre>
  
  <p>So do you know why nginx is using ip instead of the DN ?</p>