0

This is my nginx configuration:

upstream local_thin_cluster {
    server 127.0.0.1:3000;
    server 127.0.0.1:3001;
}

server {
    #listen   80;

    access_log /usr/share/redmine/log/nginx_access.log;
    error_log  /usr/share/redmine/log/nginx_error.log;

    root    /usr/share/redmine/public;
    proxy_redirect  off;

    location / {
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host $http_host;

        try_files $uri $uri/index.html $uri.html @cluster;
    }

    location @cluster {
        proxy_pass http://local_thin_cluster ;
    }
}

The problem I have is that after login redirection in web application (redmine) I get the address http://local_thin_cluster/my/page.

Everything works fine on thin server.

How can I fix this so that it redirects to the same server_name/ip on which it received request. I could fix it by putting IP instead of local_thin_cluster but I don't want to hard code server_name/ip because I need to install this on several machines and need as simple configuration as possible.

1 Answer 1

2

It started working once I moved @proxy_redirect off;@ to @location@ section.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .