Skip to content
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

Support panel fastapi behind reverse proxy #7278

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Sep 15, 2024

Partial fix for #7277

An attempt to fix or make it easier to fix #7277.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Sep 15, 2024

After fixing the initial issue the next issue is that it tries to find the static assets at /static/.... But with a start command like fastapi dev script.py --root-path /some/path that is not where they should be served.

image

This would also be a problem for anyone trying to deploy this in a docker container and not at /.

I will need help to solve this.

Update: If I run the command fastapi dev script.py it looks like the app is also available at the same url and its trying to find static assets at /static where it should be looking at /some/path/static.

@MarcSkovMadsen MarcSkovMadsen changed the title Support panel fastapi on JupyterHub Support panel fastapi behind reverse proxy Sep 15, 2024
@philippjfr
Copy link
Member

Doubtful this can/should be fixed in Panel. The improved handling probably has to be in bokeh-fastapi.

@philippjfr philippjfr marked this pull request as ready for review September 15, 2024 11:31
@philippjfr
Copy link
Member

The location fix looks fine to me.

@philippjfr
Copy link
Member

pre-commit.ci autofix

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 89.74359% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.17%. Comparing base (19025e1) to head (369d7a0).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
panel/io/location.py 88.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7278      +/-   ##
==========================================
- Coverage   82.19%   82.17%   -0.03%     
==========================================
  Files         337      337              
  Lines       50363    50376      +13     
==========================================
- Hits        41398    41397       -1     
- Misses       8965     8979      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcSkovMadsen
Copy link
Collaborator Author

Doubtful this can/should be fixed in Panel. The improved handling probably has to be in bokeh-fastapi.

Do I need to do anything here?

@philippjfr philippjfr merged commit ad3a75b into main Sep 16, 2024
15 of 16 checks passed
@philippjfr philippjfr deleted the fix/launch-fastapi-on-jupyterhub-vscode branch September 16, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panel fastapi: ValueError: too many values to unpack (expected 2)
2 participants