Flower: --url_prefix does not work with path that contains a slash

Created on 17 Apr 2018  路  10Comments  路  Source: mher/flower

When I run flower with --url_prefix=/a/b/flower I get a 404 error and the text "Error, page not found" appears in the <body> tag. All the scripts and css appear correct in respect to the url_prefix. So I do actually get a document with navbar and footer, just not container-fluid.

Furthermore, accessing flower on the root-url without the path prefix unexpectedly work!

All 10 comments

I think you are missing the nginx part of things http://flower.readthedocs.io/en/latest/config.html?highlight=nginx#url-prefix. The location rewrite works as moving the root-url. Flower currently only rewrites the URLs in the HTML, but does not move the root. Also please mention this on #766 since I think it's the feature you are looking for.

Thanks for getting back to me on this issue. I didn't realise a URL rewrite is needed, or that the --prefix can only be used behind a proxy server. To be honest I don't think the documentation is clear on that point.

has to agree with @meitham that I run into the exact same issue as him.
We assumed that we don't need nginx to rewrite URL since we already did the url prefix

Same issue here.

It looks like #766 addresses this. Hopefully this gets released soon.

running in k8s, traefik.frontend.rule.type: PathPrefixStrip annotation in the ingress solved the problem

Here's the nginx annotation for Kubernetes:

nginx.ingress.kubernetes.io/rewrite-target: /$1

Hi, I am doing the same which is as mentioned here - https://flower.readthedocs.io/en/latest/config.html?highlight=nginx#url-prefix
But, still getting 404: Not Found in <body>
i am running flower --url_prefix=flower and my nginx config is

server {
    listen 80;

    location /flower/ {
        rewrite ^/flower/(.*)$ /$1 break;
        proxy_pass http://localhost:5555;
        proxy_set_header Host $host;
    }

}

The error comes in when accessing localhost:80/flower
For loclhost:5555/flower it works fine
flower version - 0.9.5

Same.

@sudarshan2906
@Etoneja
and anyone else who might be having a problem check this out
https://github.com/mher/flower/pull/766#issuecomment-655769717

@Etoneja
and anyone else who might be having a problem check this out
#766 (comment)

Solved for me. Thx!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pnijhara picture pnijhara  路  3Comments

vahdani picture vahdani  路  5Comments

kkzxak47 picture kkzxak47  路  8Comments

ghost picture ghost  路  3Comments

hero007asd picture hero007asd  路  4Comments