Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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