From 7573ecf35302d3b3d0cb1b1f0b3d1622779e5243 Mon Sep 17 00:00:00 2001 From: Imran Farhat Date: Tue, 16 Jun 2026 17:22:27 +0530 Subject: [PATCH] fix: serve Arduino frontend at /arduino/ base-href and proxy WebSocket upgrade (Bug 7) Problem: - Arduino on Cloud was not accessible via http://localhost/arduino - Angular dev server served everything at root / instead of /arduino/, so nginx's location /arduino/ proxy_pass had nothing matching to serve - Nginx /arduino/ location lacked WebSocket upgrade headers needed for Angular's live-reload dev server over the proxy Fix: - arduino-frontend's start command now includes --base-href /arduino/ --serve-path /arduino/, so Angular correctly serves under that path - Added proxy_http_version 1.1 and Upgrade/Connection headers to the /arduino/ nginx location block Note: an earlier draft of this fix mistakenly applied the same --base-href /arduino/ flag to eda-frontend (a React app, not Angular), which would have broken eSim's frontend entirely. This fix only touches arduino-frontend's command, leaving eda-frontend untouched. Testing: - http://localhost/arduino loads the Arduino on Cloud editor correctly - http://localhost/eda still loads the eSim editor correctly (no regression) --- Nginx/dev.conf.d/local.conf | 4 ++++ docker-compose.dev.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Nginx/dev.conf.d/local.conf b/Nginx/dev.conf.d/local.conf index 54e052edc..857196c33 100644 --- a/Nginx/dev.conf.d/local.conf +++ b/Nginx/dev.conf.d/local.conf @@ -38,6 +38,10 @@ server { location /arduino/ { proxy_hide_header X-Frame-Options; proxy_pass http://arduino_frontend; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; } location /kicad-symbols { diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4e473f5cd..004e0b39b 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -42,7 +42,7 @@ services: build: ./ArduinoFrontend/ command: > sh -c "npm install && - npm start" + npx ng serve --disableHostCheck --base-href /arduino/ --serve-path /arduino/" ports: - "4200:4200"