Welcome! Log In Create A New Profile

Advanced

Re: https on a specific directory only?

François Battail
December 06, 2010 03:08AM
Le lundi 06 décembre 2010 à 02:48 -0500, TECK a écrit :

> Right now, the rewrite creates a redirect loop. How can I fix that?

Use two server locations, one for http and the other one for https, like
this:

server
{
listen 80;
...
location /dir
{
rewrite ^/(.*) https://example.com/$1 permanent;
}
}

server
{
listen 443;
ssl on;
...
location /dir
{
auth_basic "Restricted Access";
auth_basic_user_file htpasswd;
...
}
}

Best regards


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

https on a specific directory only?

TECK December 06, 2010 02:48AM

Re: https on a specific directory only?

Mikhail Mazursky December 06, 2010 03:06AM

Re: https on a specific directory only?

François Battail December 06, 2010 03:08AM

Re: https on a specific directory only?

TECK December 06, 2010 03:13AM

Re: https on a specific directory only?

Igor Sysoev December 06, 2010 07:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 122
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready