Varnish reverse proxy appending port on URL



  • Hi there!

    (pfSense 2.2.3 with Varnish 3)

    We have an interesting problem using varnish

    We are on the process of migrating to pfSense from Microsoft TMG, one of the resources that we need is the ability to publish internal sites, the TMG already does this. basically the TMG redirects requests on port 80 based on the url to internal sites on different ports since we have more than one site on the same IIS

    On pfSense we managed to do this with Varnish, so this is an example:

    varnish-static-ip:80
    |
    site1.domain.com:8081
    site2.domain.com:8082

    And it works, BUT one of the sites (lets say, site 1) has a menu, when clicked on this particular menu we have a session timeout, with the url appearing with the port appended, for example:

    user types site1.domain.com/blah

    varnish redirects to internal server on port 8081

    user access site 1 normally

    user clicks on site 1 menu

    timeout

    browser now shows site1.domain.com/blah:8081

    The menus in question uses # functions, the other menus and sites works fine

    We tried with Haproxy and squid reverse proxy, they worked with the same error, but on TMG it works without problems

    We suspect some kind of configuration mismatch on varnish, but we can't pinpoint where

    Any help?

    Thanks!



  • Likely the webserver is sending url's with absolute path's specified. So better would be if it would use relative url's.. If you cant change the website then to 'fix' it you would have to rewrite the body of the replied html page's.. Haproxy cannot do that, if Varnish can i don't know..