Commit Graph

3 Commits

Author SHA1 Message Date
davidmonterocrespo24 924e1cb02a fix(nginx): use relative redirects so trailing-slash 301s preserve HTTPS
Browsers were reporting:
    Unsafe attempt to load URL http://velxio.dev/examples/
    from frame with URL https://velxio.dev/examples.

Repro:
    curl -I https://velxio.dev/examples
    → 301  Location: http://velxio.dev/examples/   ← protocol downgraded

Why: docker/nginx.conf has the container listening on `:80` only — TLS
is terminated by the host nginx in front of it (which then proxies to
http://127.0.0.1:3080). When nginx generates a trailing-slash 301 it
uses the listening protocol (http) for the absolute Location header,
not the X-Forwarded-Proto. The browser correctly blocks the redirect.

Fix: `absolute_redirect off;` makes nginx emit relative Location
headers (`Location: /examples/`), so the browser resolves them
against the original request URL and HTTPS is preserved end-to-end.

After fix:
    curl -I https://velxio.dev/examples
    → 301  Location: /examples/

Goes in the same branch as the BMP280 ninja-timeout fix because both
are deploy-blocking and small.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 04:56:35 +02:00
David Montero 4fbaac9b4d fix(nginx): bump /api/ proxy_read_timeout 300s → 600s for ESP-IDF builds
Cold ESP-IDF compiles (esp32, esp32-cam, etc.) can legitimately take
5–10 minutes — first time the project is built, ninja has to compile
the entire IDF + Arduino-ESP32 component graph from scratch. Nginx was
cutting the connection at 5 min, which surfaced as 'No response from
server' in the frontend even though the build was still progressing.

Worse, since the backend doesn't cancel the compile on client
disconnect, repeated user clicks pile up parallel ninja jobs that
saturate CPU and slow every concurrent build further.

10 min covers cold builds with comfortable margin. Long-term we should
make compile a job (POST → job_id, GET status) and cancel duplicates
server-side, but the timeout bump unblocks users today.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 15:15:11 +02:00
David Montero Crespo b736aea86a refactor: rename deploy/ → docker/ (container build, not host deploy)
The folder only holds the in-container nginx + entrypoint that the
standalone Dockerfile copies. Calling it "deploy" implied host-level
production glue, which now lives in github.com/velxio/velxio-prod.
"docker/" makes the build-time vs deploy-time split obvious.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 00:05:55 -03:00