I have a few exposed JSON
scripts / programs for quick information gathering from a server. I use nginx to expose those as just raw urls. So given the following locations:
location ~ ^/api/status/? {
rewrite ^(.*)$ /path/to/some/handler/wan.handler;
}
location ~ ^/api/status-lan/? {
rewrite ^(.*)$ /path/to/some/handler/lan.handler;
}
Why does nginx
match my status-lan
call to the status
location? So I can view my output from /api/status/
just fine, but if I view /api/status-lan/
I get the status
location instead.