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

Using absolute URLs breaks when running behind a reverse proxy. Is it even necessary to use absolute URLs? #2267

Closed
oryjkov opened this issue Feb 12, 2024 · 1 comment

Comments

@oryjkov
Copy link

oryjkov commented Feb 12, 2024

In the following screenshot, the links in "Suggested facets" use absolute URLs, while most of the other links, for e.g. json/csv export, etc use relative links. Absolute links point to the host that datasette sees, which is not what it is known by users that as it runs in docker behind a reverse proxy.

Screenshot from 2024-02-12 10-10-08

Is there a reason to use absolute URLs here (and anywhere else in the UI)? It would be great to be able to use all of datasette's functionality behind a reverse proxy.

@simonw
Copy link
Owner

simonw commented Feb 19, 2024

There are good reasons for this - it relates to ensuring Datasette works if you host it at a different URL other than /.

You should be able to fix this issue by setting the base_url option, described here: https://docs.datasette.io/en/stable/settings.html#base-url

Please re-open this issue if that doesn't work!

@simonw simonw closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants