Redirects to the wrong URL

Hi there,

I've set up Upsource to work behind a nginx as a reverse proxy just like it's described here:
Base URL is configured like It's address of reverse proxy.
Everything looks fine except one thing: redirects to the wrong URL during each login/logout attempt.

For instance I'm clicking "Logout". First request is going here:

With this request I'm obtaining 303 status and header Location with the next URL:

Obviously second request is going nowhere 'cause correct port (38280) is missing. Ok I'm manually putting port there and sending request again. Result is the same - 303 and redirect to the URL without correct port number. After several manual manipulations with the port I've finally logged out. The same story with the login.

First I've checked data/hub/conf/ file. Each URL in this file contains correct port number. Then I've a little bit investigated log files and found there one strange record:

[JetPassUrlDAO                 ] CAS URL:

Probably this record is somehow connected with my problem. So my question is what could be the reason of such a behavior? Look forward to your reply.



Hi Artem,

Sorry for the delayed response.

We would need some additional information in order to understand what went wrong with your configuration. So, when you have a chance please zip and post entire contents of the this folders - "logs", "conf", located in Upsource home directory.

Thanks in advance.


Thank you for your support! I've attached desired directories. I was able to reproduce described problem at this timestamp: Mon Jan 19 11:43:26 MSK 2015.

Here's configuration of nginx:

server {

    listen 80;


    location  / {

        proxy_set_header X-Forwarded-Host $host;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_http_version 1.1;

        # to proxy WebSockets in nginx

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        proxy_pass http://localhost:1111/;




Hi Artem,
Due to your proxy configuration, listen port is 80, but Upsource is configured with port 38280. Who is listening this port? Do you have another proxy server?    


Hi Artem,

Actually, network configuration is quite complicated. On this machine is only web-server, which is listening on 80 port. But I'm able to access this machine only through the NAT. So, internal adress is like 192.168.something:80 which is mapped to Sorry, I've forgotten to mention such important part of configuration.


Hello, Artem!

I have investigated your issue.
it seems that information about port has been lost while request had been passed through the NAT.

Could you please try to change proxy configuration
proxy_set_header X-Forwarded-Host;
instead of
proxy_set_header X-Forwarded-Host $host;

(alternatively, you might change the NAT mapping from --> 192.168.<...>:80 to --> 192.168.<...>:38280 and configuring nginx to listen on port 38280)

Alexey Barsov


Hello Alexey,

Thank you for the hint, it works!



Please sign in to leave a comment.