title: Nginx URL masking to a different domain
body: <p>There's a few similar questions on SO, but none exactly mine, and I've had no luck trying to adapt their answers so far.</p>
  
  <p>I want to map the URL <code>http://sub.example.com</code> to <code>https://123.12.12.12/path</code>, such that the browser still shows the URL <code>http://sub.example.com</code>.</p>
  
  <p>My Nginx config file looks like,</p>
  
  <pre><code>server {
      listen 80;
      server_name sub.example.com;
  
      location / {
          proxy_pass https://123.12.12.12;
          rewrite ^/$ /path last;
      }
  }
  </code></pre>
  
  <p>The routing works here, but the URL displayed is <code>http://sub.example.com/path</code>. How do I make it display only <code>http://sub.example.com</code>?</p>