Last active
July 31, 2018 20:14
-
-
Save vladshub/18b7c5d340d963f1de9628abb46a48b2 to your computer and use it in GitHub Desktop.
nginx auth_request doesn't post :(
This file contains 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
#!/bin/bash | |
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 1501 ; done |
This file contains 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
#!/bin/bash | |
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 1500 ; done |
This file contains 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
server { | |
listen 80; | |
server_name localhost; | |
auth_request /auth; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
location /api { | |
proxy_pass "http://127.0.0.1:1501/"; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
location = /auth { | |
internal; | |
proxy_pass "http://127.0.0.1:1500/"; | |
proxy_pass_request_body on; | |
proxy_pass_request_headers on; | |
proxy_set_header X-Original-URI $request_uri; | |
proxy_set_header X-Original-Method $request_method; | |
proxy_set_header Host $http_host; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment