Welcome! Log In Create A New Profile

Advanced

How to use auth_basic authentication if ssl_client_certificate is not provided?

Posted by alesnav 
How to use auth_basic authentication if ssl_client_certificate is not provided?
June 09, 2014 01:12PM
Hello,

I looked for any help with this kind of configuration, but I was unable to find any. The only link related to this, is another question in stackoverflow (https://stackoverflow.com/questions/23716588/nginx-config-how-to-use-auth-basic-authentication-if-ssl-client-certificate-non#)

I want to config Nginx with "ssl_verify_client optional;", giving two options:

1.- If you send a valid client certificate, allow access
2.- If don't, login through auth_basic form.

Is it possible to configure Nginx this way?

I tested it using the same procedure than stackoverflow's user, but... it does not work.

if ($ssl_client_verify != SUCCESS) {
auth_basic "Please login";
auth_basic_user_file .passfile;
}

The error shown is the following one:

"auth_basic" directive is not allowed here in .../ssl.conf:19

Thanks!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 218
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready