Search code examples
http-redirectnginxvarnishphpbb3

Varnish / nginx, some url's redirecting to :8080 in phpbb?


I'm using a LEMP server with Varnish so nginx is on :8080 and varnish is cached on :80. The mail site works brilliant, no redirects etc but in a sub folder I have a phpBB forum installed, some of the links in the forum are being redirected to http://domain.com:8080/forum instead of http://domain.com/forum where they should be going.

I have added

port_in_redirect off;
to my main nginx.conf but this only seems to work on the main site and doesn't work in the phpBB sub folder.

Does anyone know a solution to stop phpBB redirecting to :8080 ?

Thanks


Solution

  • I also ran into this issue some time ago. I found the answer to this at: https://serverfault.com/questions/227742/prevent-port-change-on-redirect-in-nginx

    You can turn of the port forwarding for redirects in nginx by setting

    port_in_redirect off;