0
votes

We are currently switching from Pound to Nginx for our reverse proxy, I have everything working except for one site.

We have a split DNS setup. All of our webservers are behind our firewall. If you are on our network our internal DNS points directly to our webservers. If you are outside our network our external DNS points to our reverse proxy, which forwards traffic through our firewall to the webservers.

We have one site which is of course vendor software (horray!) basically if our users go to http://abc.foo.com the server sends a 302 redirect code and point them to https://login.vendorsite.com

This redirect works on the inside, but if you connect from the outside the 302 redirect never makes it thorugh nginx. They stay on abc.foo.com and instead a 200 status is returned by Nginx.

We never had this issue with Pound, pound allows the redirect through with no issue.

Here is my current config for nginx:

server {
    listen 80;
    server_name abc.foo.com;

    location / {
        proxy_set_header Host &host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://webserveripaddress;
    }
}
2
Nevermind, see answer below. - Aron Brown

2 Answers

0
votes

I guess you're missing something, but if it really that simple you just can use return

location / {
     return 301 http://webserveripaddress;
}
0
votes

Apparently we are no longer using the internal server for abc.foo.com They changed the DNS entry on the external DNS and never removed the information from the old reverse proxy since "it didn't go there anymore anyway".

So Nginx is working as it should.