-
QuestionI'm running a server accessible via Cloudflare tunnel. It works most of the time, but occasionally I get a "Connection lost. Trying to reconnect..." page that stays forever. Inspecting this in Edge, I see a lot of syntax errors and Any idea what may be going wrong here? I suspect it has something to do with Cloudflare caching, but I'm not sure why it works most of the time and occasionally does this. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
That is really tricky to debug. Does it also happen with a very simple "hello world" NiceGUI example? Does it work without Cloudflare? Maybe the Cloudflare logs or the server logs can provide more insight. To activate uvicorn server logging pass |
Beta Was this translation helpful? Give feedback.
-
Just to follow up, I finally figured out what the issue was here. Looking at: nicegui/examples/authentication/main.py Line 30 in 1e77878 I saw that This link explains how to create a bypass policy: https://developers.cloudflare.com/cloudflare-one/policies/access/#bypass You need to create an 'application' to bypass a certain subpath for auth. Some more info on policy inheritance and subpaths: https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/#policy-inheritance |
Beta Was this translation helpful? Give feedback.
Just to follow up, I finally figured out what the issue was here. Looking at:
nicegui/examples/authentication/main.py
Line 30 in 1e77878
I saw that
/_nicegui
is bypassed in the authentication example. I had to set this up similarly in Cloudflare Zero Trust.This link explains how to create a bypass policy:
https://developers.cloudflare.com/cloudflare-one/policies/access/#bypass
You need to create an 'application' to bypass a certain subpath for auth. Some more info on policy inheritance and subpaths:
https://developers.cloudflare.com/cloudflare-one/policies/access/app-pa…