diff --git a/nginx.conf b/nginx.conf index ea3db58..ade3d5d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -41,6 +41,41 @@ http { root /usr/share/nginx/html; index index.html index.htm; + # Belki calculator runs as a separate k3s web service. Keep the + # legacy CatWar static site at /, but forward calculator pages and + # their root-relative API calls to the Belki MetalLB service. + location = /belki { + 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 X-Forwarded-Proto $scheme; + proxy_pass http://10.12.0.212/belki; + } + + location = /belki/ { + 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 X-Forwarded-Proto $scheme; + proxy_pass http://10.12.0.212/belki/; + } + + location = /admin { + 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 X-Forwarded-Proto $scheme; + proxy_pass http://10.12.0.212/admin; + } + + location ^~ /api/ { + 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 X-Forwarded-Proto $scheme; + proxy_pass http://10.12.0.212; + } + location / { try_files $uri $uri/ =404; autoindex on;