title: Nginx URL masking http to https
body: <p>This is a similar question but not identical to the existing ones.</p>
  <p>I want to URL mask some HTTPS websites with my own website.
  I configure Nginx like this:</p>
  <pre><code>server{
      listen 1414;
      server_name mySite.com;
  
      resolver 8.8.8.8;
      location / {
          #proxy_pass HTTP://ww.google.com; # this working - I see google content and the URL stays mySite.com
          proxy_pass https://www.kaspersky.com/ # 301 ridirect
      }
  
  }
  </code></pre>
  <p>What I want:</p>
  <p>I want that the user will browse mySite.com and will see the content from some HTTPS site (for the example <a href="https://www.kaspersky.com/" rel="nofollow noreferrer">https://www.kaspersky.com/</a>) but the URL will still be mySite.com.</p>
  <p>What happened:</p>
  <p>on HTTP site (or supportive HTTP like <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a>) - everything works as expected.
  on HTTPS site, I get redirect 301 from Nginx and the URL replaced to <a href="https://www.kaspersky.com/" rel="nofollow noreferrer">https://www.kaspersky.com/</a></p>
  <p>How can I enforce Nginx to work like this:
  client &lt;-&gt; Nginx &lt;-&gt; <a href="https://www.kaspersky.com/" rel="nofollow noreferrer">https://www.kaspersky.com/</a>
  such that from the client perspective the content is mySite.com content and not <a href="https://www.kaspersky.com/" rel="nofollow noreferrer">https://www.kaspersky.com/</a> content</p>