https on a specific directory only?

Igor Sysoev igor at
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 default_server backlog=1024 rcvbuf=32k
> sndbuf=8k;
> 	listen 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  ^$request_uri?  permanent;

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

Igor Sysoev

More information about the nginx mailing list