Sfoglia il codice sorgente

fix: Caddyfile.dev strips /api prefix before proxying to API container

handle_path /api/* rewrites the path to / before forwarding to the
Express backend, fixing 502 Bad Gateway from Caddy passing /api/health
instead of /health to the API container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kingkong 1 mese fa
parent
commit
dffc671e59
1 ha cambiato i file con 23 aggiunte e 0 eliminazioni
  1. 23 0
      Caddyfile.dev

+ 23 - 0
Caddyfile.dev

@@ -0,0 +1,23 @@
+# DEV environment: serves on port 8082
+# Reverse proxy forwards decrypted HTTP traffic from Synology to this port.
+:8080 {
+    # HLS segments, thumbnails, uploaded raw files
+    @uploads {
+        path /uploads/*
+    }
+    handle @uploads {
+        uri strip_prefix /uploads
+        root * /app/uploads
+        file_server
+    }
+
+    @api path /api/*
+    handle_path /api/* {
+        reverse_proxy vidreview-api-dev:3001 {
+            header_down -Origin
+        }
+    }
+    handle {
+        reverse_proxy vidreview-frontend-dev:3000
+    }
+}