Skip to content

Instantly share code, notes, and snippets.

@nolim1t
Created December 15, 2021 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolim1t/4380c34df24a7d92eb2ea304829601d3 to your computer and use it in GitHub Desktop.
Save nolim1t/4380c34df24a7d92eb2ea304829601d3 to your computer and use it in GitHub Desktop.
Regex based forwarding for nginx
server {
# match all requests
location ~ ^(.*)$ {
# send headers to client
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
# forward to below
proxy_pass http://localhost:12345;
}
# listen on ports
listen 80;
listen [::]:80;
# server entry
server_name servername.nolim1t.co;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment