Просмотр исходного кода

Fix nginx upstream resolution for host network mode

Use 127.0.0.1:8080 instead of backend:8080 since frontend runs
with network_mode: host, which disables Docker DNS resolution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 3 недель назад
Родитель
Сommit
73b92f880b
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      nginx.conf

+ 4 - 4
nginx.conf

@@ -14,7 +14,7 @@ server {
 
     # API proxy to backend container
     location /api/ {
-        proxy_pass http://backend:8080;
+        proxy_pass http://127.0.0.1:8080;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -23,7 +23,7 @@ server {
 
     # WebSocket proxy
     location /ws/ {
-        proxy_pass http://backend:8080;
+        proxy_pass http://127.0.0.1:8080;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "upgrade";
@@ -35,7 +35,7 @@ server {
 
     # Static files from backend (pattern previews, custom logos)
     location /static/ {
-        proxy_pass http://backend:8080;
+        proxy_pass http://127.0.0.1:8080;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_cache_valid 200 1h;
@@ -43,7 +43,7 @@ server {
 
     # All backend API endpoints (legacy non-/api/ routes)
     location ~ ^/(list_theta_rho_files|preview_thr_batch|get_theta_rho_coordinates|upload_theta_rho|pause_execution|resume_execution|stop_execution|skip_pattern|set_speed|get_speed|restart|shutdown|run_pattern|run_playlist|connect_device|disconnect_device|home_device|clear_sand|move_to_position|get_playlists|save_playlist|delete_playlist|rename_playlist|get_status|list_serial_ports|serial_status|cache-progress|rebuild_cache|get_led_config|set_led_config|get_wled_ip|set_wled_ip|led|send_home|send_coordinate|move_to_center|move_to_perimeter|run_theta_rho|connect|disconnect|list_theta_rho_files_with_metadata|list_all_playlists|get_playlist|create_playlist|modify_playlist|add_to_playlist|preview_thr|preview) {
-        proxy_pass http://backend:8080;
+        proxy_pass http://127.0.0.1:8080;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;