rates/frontend/nginx.conf
jtricerolph 9a0dc58b11 Add bare /health location to nginx for management monitor compatibility
The management monitor checks http://{host}:{port}/health (no slug prefix).
Adds a location = /health alias alongside the existing /rates/health
so both the slug URL (browser/NPM) and the bare path (monitor) work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 17:07:35 +00:00

57 lines
1.4 KiB
Nginx Configuration File

server {
root /usr/share/nginx/html;
location = /rates/manifest.webmanifest {
default_type application/manifest+json;
add_header Cache-Control "no-cache";
try_files $uri =404;
}
location = /rates/sw.js {
add_header Cache-Control "no-cache";
try_files $uri =404;
}
location = /rates/registerSW.js {
add_header Cache-Control "no-cache";
try_files $uri =404;
}
listen 80;
server_name _;
# 1. Central auth proxy
location /rates/api/auth/ {
proxy_pass http://10.10.10.101:3001/api/auth/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 2. App backend (Python FastAPI on port 8000)
location /rates/api/ {
proxy_pass http://backend:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Cookie $http_cookie;
proxy_read_timeout 300s;
proxy_connect_timeout 30s;
client_max_body_size 10M;
}
# 3. Health (slugged for browser use + bare for management monitor)
location /rates/health {
proxy_pass http://backend:8000/health;
}
location = /health {
proxy_pass http://backend:8000/health;
}
# 4. SPA fallback
location /rates/ {
root /usr/share/nginx/html;
try_files $uri $uri/ /rates/index.html;
}
}