Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Redirect with HTTPS with basic auth

$
0
0
but if you do that then you get redirected to https for all locations which is not what I want and if I wanted it I would do it without an if:

server {
listen 80;
server_name mydomain.com;
rewrite ^ https://$http_host$request_uri? permanent;
}

I only want all locations available through both http and https but a single location that has authentication where I want to force https. It seems that this is not possible with current nginx configuration options as the basic auth always takes precedence.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>