Discussions have wrong port appended

frdmnfrdmn New
edited June 2014 in Vanilla 2.0 - 2.8

Hello,

im using Varnish (port 80) + Nginx (port 8080) + Vanilla since about a year and it was working very well.

Yesterday i moved to a new server, and migrated all configs, virtual hosts and vcl, but for some reason now discussions have appened the ":8080" port. The weird thing, it's only on discussions: http://forums.yeahwh.at

I'm acutally using Nginx's "port_in_redirect off;", and this is also working fine since the nav links are without the http-alt port.

So it has to be somewhere in the Vanilla database/cache or configuation. I used a simple "grep -R 8080" but i cant figure out what i'm missing.

PS: If i try <?php print_r($_SERVER["SERVER_PORT"]); ?> it's returning 8080 though. Is it the Nginx after all?

Thanks in advance
Jonas

Comments

  • I just found out adding the following fastcgi parameter in Nginx can temporary fix this problem:

    fastcgi_param SERVER_PORT 80;

    However, i wonder why it worked without any issues on the old server. Any idea?

  • x00x00 MVP
    edited June 2014

    see this bug

    http://vanillaforums.org/discussion/comment/202051#Comment_202051

    nginix equivalent would be

    fastcgi_param  PHP_VALUE   "auto_prepend_file=/path/to/portfix.php";
    

    Then for portfix.php

    <?php
    if(@isset($_SERVER['HTTP_HOST']) && substr($_SERVER['HTTP_HOST'],-5)==':8080')
    $_SERVER['HTTP_HOST'] = substr($_SERVER['HTTP_HOST'],0,-5);
    if(@isset($_SERVER['HTTP_X_FORWARDED_HOST']) && substr($_SERVER['HTTP_X_FORWARDED_HOST'],-5)==':8080')
    $_SERVER['HTTP_X_FORWARDED_HOST'] = substr($_SERVER['HTTP_X_FORWARDED_HOST'],0,-5);
    

    grep is your friend.

Sign In or Register to comment.