Welcome! Log In Create A New Profile

Advanced

Directive only for certain alias

Posted by cicovy 
Directive only for certain alias
August 31, 2011 08:46AM
Hi guys!
I've been using nginx for a while and I'm very pleased with it's performance. However, I didn't manage to setup one thing, maybe someone has an idea...

Before using nginx, I used apache and I had a configuration similar to the next one for certain alias, which I want to force client SSL requirement and for other areas of the site I didn't need that. I've posted the example of apache configuration below. Is there anything similar for this in nginx? I need to have "ssl_verify_client optional;" in certain aliases and "ssl_verify_client on;" in 2 of my aliases.

Thank you for any hint you may provide!

Alias /myalias /var/www/server/alias
<Directory /var/www/server/alias>
SSLCipherSuite HIGH:MEDIUM
SSLCACertificatePath /etc/CA/
SSLCACertificateFile /etc/CA/cacert.pem

SSLVerifyClient require
SSLVerifyDepth 1

SSLOptions +StdEnvVars

AllowOverride All
Allow from All
</Directory>
Re: Directive only for certain alias
August 31, 2011 09:56AM
I just found out that it's not possible to add ssl_verify_client directive in a "location". I received a suggestion from @kolbyjack on the nginx IRC channel which helped me with this problem. The solution was to deal with the $ssl_verify_client returning value.

if ($ssl_client_verify != SUCCESS) {
return 401;
break;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready