Created
August 23, 2014 00:13
-
-
Save leafo/efa94ae9e6e53bc202db to your computer and use it in GitHub Desktop.
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
worker_processes 1; | |
error_log stderr notice; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 8080; | |
resolver 8.8.8.8; | |
location ~* ^/proxy_test/(.*?)/(.*) { | |
proxy_pass_request_headers off; | |
proxy_pass http://$1/$2; | |
} | |
location ~* ^/test/(.*?)/(.*) { | |
set $a $1; | |
set $b $2; | |
content_by_lua ' | |
local url = "/proxy_test/" .. ngx.var.a .. "/" .. ngx.var.b | |
res = ngx.location.capture(url) | |
ngx.header.content_type = "text/plain" | |
ngx.say(res.status) | |
'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment