Last active
February 20, 2018 06:05
-
-
Save PH9/1a5a7b348a706bb83c277ef1ab98d527 to your computer and use it in GitHub Desktop.
nginx ngx_http_auth_request_module -> API Source Code https://github.com/PH9/auth-module
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
upstream authserver { | |
server 192.168.1.38:12800; | |
server 192.168.1.39:12800; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
auth_request /auth; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
location = /auth { | |
proxy_pass http://authserver/authenticate; | |
proxy_pass_request_body off; | |
proxy_set_header Content-Length ""; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Original-URI $request_uri; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment