Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Discussions have wrong port appended

frdmnfrdmn New
edited June 2014 in Vanilla 2.0 - 2.8


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:

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


  • Options

    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?

  • Options
    x00x00 MVP
    edited June 2014

    see this bug

    nginix equivalent would be

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

    Then for portfix.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')

    grep is your friend.

Sign In or Register to comment.