From d06bcb91377affba61c2630d83d21d83c5472828 Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Sun, 16 Aug 2026 17:20:30 +0300 Subject: [PATCH] fix: proxy Belki routes through k3s nginx --- nginx.conf | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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;