nginx fastcgi get SSL information?

Basically, you can retrieve the client SSL certificate with

fastcgi_param SSL_CLIENT_CERT $ssl_client_raw_cert if_not_empty;

If you need more variables or a strict compatibility with Apache, you can find a port to nginx of the standard Apache SSL variables: github.com/Seb35/nginx-ssl-variables (not completely finished as of now).

With this installed, your application will see the same variables as with Apache. nginx gives native access to some variables, but you will need Lua and Lua-OpenSSL to have more variables.

Read more here: Source link