Doesn't work with applications which use absolute URLs
See original GitHub issueI’ve noticed that a few applications that I’ve tried to proxy recently use absolute urls.
For example when running on a regular server if you go to http://localhost:1234/
it will look for a stylesheet at/style/index.css
. This works fine when running locally but when using nbserverproxy I visit http://localhost:8888/lab/proxy/1234
which still looks for styles at /style/index.css
rather than /lab/proxy/1234/style/index.css
.
These applications often take a baseurl
config option somewhere which lets you prepend all urls with a base path, such as /lab/proxy/1234
. This would allow me to fix this functionality. However it appears nbserverproxy rewrites its urls so when I visit http://localhost:8888/lab/proxy/1234
the path gets rewritten to /
. This then causes problems because the application is now expecting a base url of /lab/proxy/1234/
. This results in the HTML page not displaying because flask or whatever doesn’t have a route for /
, but the CSS would display ok if it were ever requested.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top GitHub Comments
That sounds like a pragmatic fix. Perhaps something like
proxy_abs
for absolute urls?We could add an option to (not) rewrite URLs to the proxy?
http://localhost:8888/lab/dont_rewrite_me_proxy/1234/
(maybe a slightly shorter URL 😉 )