Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

How to use auth_basic authentication if ssl_client_certificate is not provided?

$
0
0
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!!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>