Skip to content

Instantly share code, notes, and snippets.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment