-
Notifications
You must be signed in to change notification settings - Fork 17
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
HTML served with <img src=http://localhost:3100> even with
HOST=10.0.0.1 myst start --keep-host`
#342
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Looks like article-theme does the same thing |
On the idea of making it a relative path, RFC3986 Section 5.2.2 says you can't change the port in a relative path. If you need to change the port, you have to specify the entire "authority" (host:port). |
I am not sure this is relevant. About the |
I think this could be on the right track as this is where the url's get re-written based on the CONTENT_CDN and that is what is setting the image paths to There is a possible change to make here and a parallel change needed in |
Probably worth mentioning the context for the other discussions in |
I see... tagging these issues jupyter-book/mystmd#994 & jupyter-book/mystmd#994 so in using relative paths are you suggesting proxying to the content server when running the development server so get around the different port mapping? (I don't follow on the need for the additional .html suffix, though as all content files get .html extensions in the static build -- but I probably need to dig into the other issue a bit more) |
Kinda, basically this fixes both the static site generation and serving behind a reverse-proxy because in both cases it will navigate based on whatever url it was served, beit
For context, you can check: https://mystmd-temp.readthedocs.io/latest/ which was generated from the static builder. (The site is not navigable1). Yes, all html files were downloaded, but the links were those of Footnotes |
Describe the bug
When I have a fresh install with the mystmd-quickstart, and do a
HOST=10.0.0.1 myst start --keep-host
,I expect to remotely access
http://10.0.01:3000
and have it serve the entire web page,but instead, while most assets are loaded from relative links and work fine,
<img src>
tags point to an absolute URL ofhttp://localhost:3100/...
(see picture below of incorrect links in the client browser)However, the server is binding to 10.0.0.1 and will serve the asset file. (see picture below of directly accessing the asset URL with the correct domain instead of
localhost
)This is a problem for people trying to use mystmd through a SSH connection to the big server where they do their computational work and where their Jupyter notebooks live and run.
To try to help, could it be related to the hardcoded
localhost
below? It seems like this would be fixed if this was a relative path like the other assets.https://github.com/executablebooks/myst-theme/blob/e549832055fa51faacc1f3966201e659a1365560/themes/book/app/utils/loaders.server.ts#L14
Reproduce the bug
myst start --keep-host
List your environment
$ myst --version
v1.1.48
$ myst templates list --site book-theme
ID: site/myst/book-theme
Version: 1.0.0
The text was updated successfully, but these errors were encountered: