Skip to content

Instantly share code, notes, and snippets.

@mrngm
Created January 27, 2018 19:21
Show Gist options
  • Save mrngm/01b7e1875a52ce88e43337d7f5e743fa to your computer and use it in GitHub Desktop.
Save mrngm/01b7e1875a52ce88e43337d7f5e743fa to your computer and use it in GitHub Desktop.
Proxy wildcard domains to another port
server {
listen [::]:80;
server_name ~^(.+)$;
location / {
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_redirect off;
proxy_pass http://127.0.0.1:81$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment