title: configure /etc/nginx/nginx.conf to redirect to separate host
body: <p>Does anyone know how to modify the nginx.conf file to redirect to another host? I would like to direct <a href="http://mydomain.com/page1" rel="nofollow">http://mydomain.com/page1</a> and <a href="http://mydomain.com/page2" rel="nofollow">http://mydomain.com/page2</a> to separate hosts on my local network. mydomain.com/page1 should go to 10.100.0.163 and mydomain.com/page2 should go to 10.100.0.164.</p>
  
  <p>Here is what I added to the HTML section of the nginx.conf file on my Ubuntu server.</p>
  
  <pre><code>location /page1/ {
  rewrite ^/page1/(.*)$ http://10.100.0.163/$1 permanent;
  }
  
  location /page2/ {
  rewrite ^/page2/(.*)$ http://10.100.0.164/$1 permanent;
  }
  </code></pre>
  
  <p>Is there anything else I need to add to the nginx.conf file? Are there any other configuration files I also need to modify?</p>
  
  <p>I just did a standard install of nginx and haven't changed anything else.</p>