Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed varnish on my site and got this problem... If I go to my site ( and click on the top link for the forum, the browser takes some tme and then takes me to (Its broken!) It should go to Sometimes it works and sometimes it give this problem! How can I fix this?

I have Nginx installed in my Ubuntu server... Please help!

(I saw the same problem in serverfault but the answer says its a apache problem... In here im using Nginx!)

share|improve this question
Try adding port_in_redirect off; to your nginx.conf. – cyberx86 Mar 21 '12 at 18:48
@cyberx86 Thanks a lot my friend! It solved the problem! – THpubs Mar 22 '12 at 2:39
Please mark cyberx86's answer as correct! – 3molo Mar 22 '12 at 8:52
up vote 3 down vote accepted

Adding port_in_redirect off; to your nginx.conf should fix the problem. As the name suggests, this directive will prevent Nginx from adding the port to the url when a request is redirected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.