be-hase / relumin

Redis cluster admin tool
Apache License 2.0
63 stars 25 forks source link

Does not work correctly behind a Nginx Reverse Proxy with context root other than '/' #6

Open ShahBinoy opened 8 years ago

ShahBinoy commented 8 years ago

I am using nginx as a reverse proxy in front of relumin. below is the config

   location /cluster {
            proxy_pass http://72.128.146.180:9090;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $http_x_forwarded_for;
            proxy_set_header REMOTE_ADDR $http_x_real_ip;
            proxy_set_header Host $http_host;
    }
    location /login {
            proxy_pass http://72.128.146.180:9090/login;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $http_x_forwarded_for;
            proxy_set_header REMOTE_ADDR $http_x_real_ip;
            proxy_set_header Host $http_host;
    }
    location /vendor {
            proxy_pass http://72.128.146.180:9090/vendor;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $http_x_forwarded_for;
            proxy_set_header REMOTE_ADDR $http_x_real_ip;
            proxy_set_header Host $http_host;
    }

But after login the redirection happens to '/' root context and the application does not work further than that.

Can this be changed to redirecting to the relative root context ?

be-hase commented 8 years ago

@ShahBinoy Thanks for your report.

I will try on next version. Please wait. :D

be-hase commented 8 years ago

Hi.

Why don't you use this setting?

location / {
            proxy_pass http://72.128.146.180:9090;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $http_x_forwarded_for;
            proxy_set_header REMOTE_ADDR $http_x_real_ip;
            proxy_set_header Host $http_host;
}

I wonder why you separate location setting. location /cluster, location /login, location /vendor

ShahBinoy commented 8 years ago

I wanted to provide different proxy endpoints to different users. So wanted to separate out some portions with basic Auth. I will try again. Thank you for response.