-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 running flower with a url prefix #13
Conversation
Thanks for the patch! Why don't you use tornado static_url_prefix option? |
static_url_prefix combined with nginx rewrite seems a better solution |
My initial attempt just used nginx rewriting, but I found this was ineffective as flower generates and uses lots of absolute URLs for its webservice and url endpoints. Just nginx rewriting results in these being broken links. My understanding from reading the tornado source is that static_url_prefix only affects static resources, so I don't follow how this is sufficient to make non-static resources link properly. |
$(location) can be used in js to get a prefix for non-static urls |
A new --url_prefix option enables to deploy flower with url prefix |
To access flower from http://example.com/flower simply run "flower --url_prefix=flower" and use nginx rewrite ^/flower/(.*)$ /$1 |
Sample nginx config:
|
In case anyone else uses this sample, I found I needed to make the match a regex, and the slash optional, because the link behind the 'Celery Flower' label/logo is generated without a trailing slash. Not a big deal, just annoyed me :)
|
We run a number of monitoring services and dashboards on our machines behind nginx, each accessible under a different prefix (http://www.example.com/munin/, http://www.example.com/rabbitmq, etc.) This doesn't work with flower as it expects to always be at the root of the host it is running under.
This patch adds a --prefix command line option allowing you to specify a prefix. This means it can be run under an arbitrary location.