My nginx reverse proxy configuration is as follows:
location ^~ /a(pi|uth) {
proxy_pass http://localhost:3000;
# Proxy Settings
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
...
}
Hope that requests from /api/*
and /auth/*
are sent to port 3000, but it seems that the matching is not successful. I think there should be no problem with regular expressions
javascript
/a(pi|uth)/.test('api') // true
I directly location ^~ /api
can be matched, but it doesn’t work if I use regular expressions. I don’t know what’s going on
After looking at it, it seems that
^~
does not match the regular expression