mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-08-26 17:31:37 +00:00
nginx: use ^~ prefix on /api/traffic/ to beat .png regex catch-all (fixes latent 404 bug)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dfd1d38405
commit
ad097432fc
1 changed files with 5 additions and 1 deletions
|
|
@ -30,7 +30,11 @@ proxy_cache_path /mnt/nav/tile-cache/traffic levels=1:2
|
|||
# `/api/` regardless of order — placing it first keeps the file readable and
|
||||
# makes the precedence obvious to a human.
|
||||
# -----------------------------------------------------------------------------
|
||||
location /api/traffic/ {
|
||||
# ^~ is REQUIRED: the vhost has a `location ~* \.(...|png|...)$` regex catch-all,
|
||||
# and in nginx a matching regex beats a plain prefix. Traffic tiles end in .png,
|
||||
# so without ^~ the regex intercepts them and serves a 404 from the static root.
|
||||
# ^~ tells nginx to skip regex evaluation when this is the longest prefix match.
|
||||
location ^~ /api/traffic/ {
|
||||
proxy_pass http://127.0.0.1:8421;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue