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

URL_PREFIX feature for web UI? #149

Closed
jpotter opened this issue May 8, 2014 · 3 comments · Fixed by #692
Closed

URL_PREFIX feature for web UI? #149

jpotter opened this issue May 8, 2014 · 3 comments · Fixed by #692

Comments

@jpotter
Copy link

jpotter commented May 8, 2014

Hi,

Is it possible to add a --url-prefix option for the web ui, so that proxy setups can run the web ui under a sub-url? We want to run locust proxied behind our https server, which proxies other services like @Jahaja 's ps-dash, and to do this requires any assets being loaded to be fetched either relative to "./" or full-pathed under a known prefix.

Thanks,
Jeff

@heyman
Copy link
Member

heyman commented May 9, 2014

Hi!

I think we should provide some way of doing this. Until it's implemented, my recommendation would be to setup the proxying to use a sub-domain for exposing the web ui.

I tried to come up with a hackish way to do it with the currently released version. Putting the following in your locustfile will expose all of the web UI's endpoints under a prefix path:

from locust import web
from werkzeug.wsgi import DispatcherMiddleware
web.app = DispatcherMiddleware(web.app, {"/locust": web.app})

However, I realised that we use hard-coded absolute URL's in the front-end, so unfortunately it won't work.

@jpotter
Copy link
Author

jpotter commented May 9, 2014

Thanks! I ended up adding a dedicated port on our apache server to do ssl termination and proxy through to the back end, so this will work for us. I'll leave this open though so that it's tracked in the issues section, in case others want it.

@karol-brejna-i
Copy link
Contributor

Similar problem when trying to expose locust UI via Kubernetes' ingress.

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

Successfully merging a pull request may close this issue.

3 participants