0

I have my Nginx web server running on both HTTP and HTTPS. If the application tries to open:

https://myapp.com/path1

it opens the application with HTTPS but when it attempts to open using:

http://myapp.com/path1

the browser uses its cache and opens with https. How could I prevent this? I have a button to open specific webpages. When someone clicks on the button, I create the URL and then call:

window.open(previewURL, "_blank");

Is there a way where I can force the browser to open using http when I want in http and https when I want in https?

If I open the webpage in a private window (incognito), the browser then won't redirect.

Amanda
  • 1,601
  • 9
  • 25
  • so your nginx isn't set to redirect http to https? – Jaromanda X May 18 '20 at 04:45
  • @JaromandaX No. This is intentional. A preview could either be opened with `http` or `https`. – Amanda May 18 '20 at 04:46
  • Is there a way to supply the rest of the code leading up to window.open? (or perhaps a link to the server, or a test/temp version of it, for us to test it?) – bluejayke May 18 '20 at 05:04
  • https://stackoverflow.com/a/2068407/2016831 – bluejayke May 18 '20 at 05:07
  • @bluejayke Even after doing the cache thing, the browser still redirects to https. When I clear the cache, it works fine the very first time. But if I refresh, it redirects to https – Amanda May 18 '20 at 05:57

0 Answers0