-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow hosting behind reverse proxy with prefixed path #258
Conversation
using patch from pull request justpy-org/justpy#258
Thank you for this. I see why it is important and would be valuable in the package. Unfortunately, I do not have the experience nor the setup to test this if it is incorporated into justpy. Just thinking out loud, can this made into a standalone package, a version of justpy for reverse proxies? |
Interesting! It would still require some extensive hook-points within Justpy:
This would be much better than my hack for our NiceGui library which is based on Justpy. Currently I saw no other option then to apply the patch into the installed Justpy library within a docker container. Obviously this should be replaced as soon as possible. |
Give me a few days to think this over and figure out how much change is needed in the code. I was thinking more along the following lines: Once a version of JustPy is ready, if this is something worth your time, you would make the changes required and test the package in your configuration. Then you could publish a package called for example justpy-reverse-proxy for people to use. Since you have experience with docker, perhaps you could define a container that would make it simple for people to deploy JustPy? Any ideas in general on how to make deployment as simple as possible would be much appreciated. A command that takes a JustPy project and deploys it to one of the cloud service providers would be a huge improvement to the project. |
I found a solution which only needs modifications in the template dir and hence can be used on top of Justpy without code modifications. I just copied the original templates dir and applied this changes. |
I started a new discussion about the dockerization at #260 |
This is great, thank you. I will include this in the next version of JustPy. |
To be hosted behind a reverse proxy like Traefik or nginx Justpy needs to be aware about the prefixed path. These proxies provide a
X-Forwarded-Prefix
header for this purpose. On the browser side we can use thelocation.pathname
to access the prefix and establish the connection accordingly.