flower icon indicating copy to clipboard operation
flower copied to clipboard

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

Open meitham opened this issue 8 years ago • 10 comments

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!

meitham avatar Apr 17 '18 15:04 meitham

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.

scrummyin avatar May 02 '18 13:05 scrummyin

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.

meitham avatar May 04 '18 12:05 meitham

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

shaohua avatar Jun 02 '18 02:06 shaohua

Same issue here.

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

mascah avatar Aug 29 '18 14:08 mascah

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

zakkg3 avatar Sep 17 '19 14:09 zakkg3

Here's the nginx annotation for Kubernetes:

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

sebnyberg avatar Sep 01 '20 18:09 sebnyberg

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

sudarshan2906 avatar Oct 05 '20 12:10 sudarshan2906

Same.

Etoneja avatar Oct 06 '20 09:10 Etoneja

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

your-favorite-dev avatar Oct 06 '20 22:10 your-favorite-dev

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

Solved for me. Thx!

Etoneja avatar Oct 06 '20 23:10 Etoneja