From 16b08994cc418e38deb9a00a44a9a99b83cb713a Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 16 Jan 2026 12:53:10 +0100 Subject: [PATCH] Try fixup mixed conten error loading widget --- backend/dev_nginx.conf | 24 +++++++++++++++++++++--- playwright/widget/test-helpers.ts | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/backend/dev_nginx.conf b/backend/dev_nginx.conf index be015060..d3ddbc53 100644 --- a/backend/dev_nginx.conf +++ b/backend/dev_nginx.conf @@ -181,7 +181,10 @@ server { } -# Convenience reverse proxy for the call.m.localhost domain to yarn dev --host +# Convenience reverse proxy for the call.m.localhost domain to element call +# running on the host either via +# - yarn dev --host or +# - falling back to http (the element call docker container) server { listen 80; listen [::]:80; @@ -197,7 +200,7 @@ server { ssl_certificate /root/ssl/cert.pem; ssl_certificate_key /root/ssl/key.pem; - + # 1. Attempt HTTPS first location ^~ / { proxy_set_header Host $host; @@ -208,8 +211,23 @@ server { proxy_pass https://host.docker.internal:3000; proxy_ssl_verify off; + # 2. Redirect specific errors (e.g., 502 Bad Gateway or 504 Timeout) + # to the named fallback location + error_page 502 503 504 = @http_fallback; + + } + + # 3. Fallback location using HTTP + location @http_fallback { + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_pass http://host.docker.internal:8080; + } - error_page 500 502 503 504 /50x.html; } diff --git a/playwright/widget/test-helpers.ts b/playwright/widget/test-helpers.ts index 63092a4d..ff3cb121 100644 --- a/playwright/widget/test-helpers.ts +++ b/playwright/widget/test-helpers.ts @@ -248,7 +248,7 @@ export class TestHelpers { "Developer.elementCallUrl", null, "device", - "http://localhost:8080/room", + "https://call.m.localhost/room", ); }); } else {