From 19884b7b5d5d384ceb29012bbbc0ecfad902c961 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Fri, 26 Jun 2026 11:01:03 +0200 Subject: [PATCH] fix: use Docker resolver for backend DNS in nginx.conf --- frontend/nginx.conf | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 8e56511..9ed4134 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -2,7 +2,23 @@ server { listen 80; root /usr/share/nginx/html; index index.html; + + resolver 127.0.0.11 valid=30s; + location / { try_files $uri $uri/ /index.html; } - location /api/ { proxy_pass http://backend:3001; } - location /ws { proxy_pass http://backend:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } + + location /api/ { + set $backend http://backend:3001; + proxy_pass $backend; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } + + location /ws { + set $backend http://backend:3001; + proxy_pass $backend; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } }