Welcome! Log In Create A New Profile

Advanced

https on a specific directory only?

December 06, 2010 02:48AM
Hi all,

I recently purchased a SSL certificate and I would like to use it only on a specific location:

[code]
server {
listen 10.30.1.50:80 default_server backlog=1024 rcvbuf=32k sndbuf=8k;
listen 10.30.1.50:443 ssl;
server_name www.domain.com;
ssl_certificate domain.com.crt;
ssl_certificate_key domain.com.key;
...
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}

location /dir/ {
auth_basic "Restricted Access";
auth_basic_user_file htpasswd;
rewrite ^ https://www.domain.com/dir$request_uri? permanent;
}
...
}
[/code]

In other words, if you access the scheme with a http value, it redirects you to the https scheme.
I really don't want to use any IF's as conditionals.
Right now, the rewrite creates a redirect loop. How can I fix that?

Thanks for your help.
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: 54
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