Self deployed on a VPS behind an NGINX reverse proxy ... Backend dropouts #6133
Replies: 3 comments
|
I am investigating switching from NGINX to Caddy. :-/ Would prefer an NGINX solution. Anyone? |
|
The Chromium console is showing this error: Mixed Content: The page at 'https://aquaterrapm.ca/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://aquaterrapm.ca/_event/?token=087e610b-20f0-451a-941c-1f76f684eff9&EIO=4&transport=websocket'. This request has been blocked; this endpoint must be available over WSS. |
|
The Chromium error you posted is the root cause: the page is HTTPS, but the frontend opens the event socket on Where that URL comes from (Reflex source:
So your frontend was exported with an
NGINX then only needs to forward the backend routes (the same ones Reflex's Caddyfile example uses) to the backend, with WebSocket upgrade headers: location ~ ^/(_event|ping|_health|_upload) {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 86400;
} |
Uh oh!
There was an error while loading. Please reload this page.
I'm using rootless podman container(s) to run a Reflex app on a cloud VPS behind a native NGINX reverse proxy. The problem I'm getting is that some browsers have a back-end timeout, while Firefox does not (at least not on all platforms). Chromium is consistently unable to connect to the back end. I've searched extensively for solutions, and tried a lot, but thus far, I'm coming up blank. I am thinking about switching out NGINX, but that seems extreme.
nginx.txt
Podman pod is working great, and the Front end is using CADDY to serve the static site (3001) and the Back end is using reflex run in PROD mode (8001) to run on the localhost ports. AFAICT I have done everything correctly, but as the results are PARTIAL success (FIrefox is OK, Chrome/Chromium is not). Also tried unsuccessfully Thorium, Brave etc on Ubuntu, and Chromium/Firefox on FreeBSD. Clearly, I am missing something. Has anyone seen this problem before?
All reactions