fix(nginx): prefix ^~ /orcid2words/ + diagnostic headers

This commit is contained in:
Alexis
2026-05-13 13:39:53 +02:00
parent 926e59891d
commit d5be910da6
+14 -3
View File
@@ -7,16 +7,27 @@ server {
index index.html; index index.html;
# Tolerante al comportamiento de Apache (con o sin strip del prefijo): # Tolerante al comportamiento de Apache (con o sin strip del prefijo):
# - Si llega `/orcid2words[/...]` → strip y servir. # - Si llega `/orcid2words/...` → strip y servir desde dist/.
# - Si llega `/` o cualquier otra ruta → servir SPA igualmente. # - Si llega `/` o cualquier otra ruta → servir SPA igualmente.
# `^~` fuerza prioridad sobre cualquier regex y evita sorpresas de matching.
# Combinado con el `basename` dinámico de `main.jsx`, React Router se adapta. # Combinado con el `basename` dinámico de `main.jsx`, React Router se adapta.
location ~ ^/orcid2words(/.*)?$ { location ^~ /orcid2words/ {
rewrite ^/orcid2words/?(.*)$ /$1 break; add_header X-Original-URI $request_uri always;
add_header X-Resolved-URI $uri always;
add_header X-Location-Hit "prefix-orcid2words" always;
rewrite ^/orcid2words/(.*)$ /$1 break;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
location = /orcid2words {
return 301 /orcid2words/;
}
location / { location / {
add_header X-Original-URI $request_uri always;
add_header X-Resolved-URI $uri always;
add_header X-Location-Hit "root" always;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
} }