refactor: Replace hardcoded backend references with variable for improved maintainability

This commit is contained in:
Your Name
2026-03-19 03:42:55 +02:00
parent 759bcd2437
commit 8358f4a413
2 changed files with 9 additions and 13 deletions

View File

@@ -1,7 +1,3 @@
upstream backend {
server backend:5000;
}
server {
listen 80;
server_name dociva.io www.dociva.io;
@@ -37,6 +33,8 @@ server {
http2 on;
server_name dociva.io;
client_max_body_size 100M;
resolver 127.0.0.11 valid=30s ipv6=off;
set $backend_upstream backend:5000;
# SSL certificates (Let's Encrypt via certbot)
ssl_certificate /etc/letsencrypt/live/dociva.io/fullchain.pem;
@@ -69,7 +67,7 @@ server {
# SSE streaming for assistant chat
location /api/assistant/chat/stream {
proxy_pass http://backend;
proxy_pass http://$backend_upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -85,7 +83,7 @@ server {
# API requests → Flask
location /api/ {
proxy_pass http://backend;
proxy_pass http://$backend_upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -109,6 +107,6 @@ server {
# Health check
location /health {
proxy_pass http://backend/api/health;
proxy_pass http://$backend_upstream/api/health;
}
}