Last active
December 23, 2015 11:00
-
-
Save jhrcz/6625052 to your computer and use it in GitHub Desktop.
nginx-satisfy-any-remoteaddr-clientcert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# satisfy any like funkcionality in nginx | |
# with client certificat or remote address | |
# | |
# based on https://sys-notes.com/bin/view/Main/NginxSSLClientAuth | |
# | |
#if ($ssl_client_s_dn !~ "(O=My Company)") { | |
# return 403; | |
#} | |
set $accessok ""; | |
if ($remote_addr ~ "123.456.789.123") { | |
set $etnok "${accessok}ok"; | |
} | |
if ($ssl_client_s_dn ~ "(O=My Company)") { | |
set $etnok "${accessok}ok"; | |
} | |
if ($accessok !~ "ok") { | |
return 403; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment