Issue when using reverse proxy #1302
Unanswered
duane-space
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Update: I resolved the elements not working issue! It was indeed a mismapping between the websocket routes for the nicegui app and the proxy. The route above was correct for the nicegui app, but was not being intepreted correctly on the proxy. Still working on fixing the issue with static files/images. Update 2 I also found a fix for the static files. I messed around with mod_proxy for a while without success, but eventually got it to work using mod_substitute. But I am sure understanding the root_path thing would lend to a much more elegant solution... |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hello! I am trying to host my NiceGUI app behind an Apache HTTP reverse proxy. I spent some time trying to get it to work at all (the issue being a "connection lost" page). I did make some progress there by messing with the proxy settings, and now I can get pages to load! However, while the page layout loads, none of the static content like images load and none of the elements (e.g. buttons) work. So it seems I only resolved the issue for a subset of the connections. I am hoping that this signature makes the exact problem obvious so I can focus my efforts on the right part of the proxy settings (e.g. http, websockets, etc), as I am a bit out of my depth. I suspect the issue is with websockets, but confirmation would be nice as it is just a guess.
If so, from logs I see this:
Should that be a correct route?
From some research, it sounded like an easier solution that messing with proxy settings might be setting the "root_path" on the NiceGUI/FastAPI/Uvicorn side of things, but I wasn't sure how to actually do that properly. What I had tried at one point before diving into the proxy, was something like this:
Which gave an error:
I wasn't able to find an example of how to properly do this (found some examples that directly created a FastAPI app instance, but I'm not sure how that would have worked in the context of my existing NiceGUI project). Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions