Forked from anonymous/gist:e3bad169481bdcafd70c04a215e3650e
Created
September 1, 2017 14:38
-
-
Save Nklya/49c23e566486ec0ba2b8e264bff08793 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
map $arg_url $u_scheme { | |
~^https https; | |
default http; | |
} | |
map $arg_url $u_host { | |
~^https?%3a%2f%2f(.*?)%2f.*$ "$1"; | |
} | |
map $arg_url $u_uri { | |
~^https?%3a%2f%2f(.*?)%2f(.*)$ "$2"; | |
} | |
resolver 8.8.8.8 ipv6=off; | |
server { | |
listen 80; | |
server_name test.test; | |
location /proxy/ { | |
proxy_pass "${u_scheme}://${u_host}/${u_uri}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment