Answer the question
In order to leave comments, you need to log in
Proxying in nginx with client certificates?
Good health to all colleagues.
Straight to the point.
There is an Apache server, on it access to aliases on client certificates is configured. Apache itself works without any complaints, but now I want scalability due to the increase in hosts that require ssl.
We have one white IP, inside behind the NAT there is a server on which Apache is spinning and people are authorized on it using certificates. Port 443 is just forwarded to this machine. Now I want to install NGINX on the router, which will proxy requests to the desired server.
The task is to leave the possibility to log in using certificates.
there are presumably 3 aliases in the patch:
/user
/admin
/guest
in Apache candy is written like this:
SSLVerifyClient require
SSLVerifyDepth 1
SSLOptions +OptRenegotiate
SSLCipherSuite HIGH:MEDIUM
SSLCACertificateFile "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/ssl/ca.cer"
SSLRequire %{SSL_CLIENT_S_DN_Email} eq "[email protected]" and %{SSL_CLIENT_M_SERIAL} eq "Serial-1" \
or %{SSL_CLIENT_S_DN_Email} eq "[email protected]" and %{SSL_CLIENT_M_SERIAL} eq "Serial-2" \
or %{SSL_CLIENT_M_SERIAL} eq "Serial-3" \
or % {SSL_CLIENT_S_DN_Email} eq "[email protected]" and %{SSL_CLIENT_M_SERIAL} eq "Serial-4" \
or %{SSL_CLIENT_M_SERIAL} eq "Serial-5"
# if ($ssl_client_serial !~ "Serial-1") { return 401;}
# if ($ssl_client_serial !~ "Serial-2") { return 401;}
# if ($ssl_client_serial !~ "Serial-3") { return 401;}
Answer the question
In order to leave comments, you need to log in
you can do something like this, if you remake your version:
# set $true 0;
# if ($ssl_client_serial = "Serial-1") {set $true 1;}
# if ($ssl_client_serial = "Serial-2") {set $true 1;}
# if ($ssl_client_serial = "Serial-3") {set $true 1;}
# if ($true=0) {return 401;}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question