Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Nklya/49c23e566486ec0ba2b8e264bff08793 to your computer and use it in GitHub Desktop.
Save Nklya/49c23e566486ec0ba2b8e264bff08793 to your computer and use it in GitHub Desktop.
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