https on a specific directory only?

Igor Sysoev igor at sysoev.ru
Mon Dec 6 15:04:00 MSK 2010


On Mon, Dec 06, 2010 at 03:13:45AM -0500, TECK wrote:

> Thanks for the reply, guys.
> The idea of "listen ssl" directive is to keep the configuration
> compact:
> 	listen				10.30.1.50:80 default_server backlog=1024 rcvbuf=32k
> sndbuf=8k;
> 	listen				10.30.1.50:443 ssl;
> 
> I only want to use SSL, in one directory. I know I can use the "long"
> method, my goal was to find out how I could do it in a compact form,
> like in my first post example. Thanks a lot for your help.

     location /dir/ {
         if ($scheme != https) {
             rewrite  ^  https://www.domain.com/dir$request_uri?  permanent;
         }
     }

However, I do not recommend this .htaccess-way.
It's much better to use seprate servers.


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list