Forum

EnforceFirstHostname when behind reverse-proxy

Gour
5 June 2016, 10:12
Hello,

I'm using Hiawatha on Webfaction hosting where it runs behind reverse-proxy (nginx) and trying to configure non-www redirects at the Hiawatha side to avoid using things like this [docs.webfaction.com].

In the past I was using redirect-rule similar to:

UrlToolkit {
ToolkitID = www_redirect_
Match ^/(.*) Redirect http://www.domain.tld/$1
}


and it work(ed)s. :-)

Now, I wanted to take advantage of:

VirtualHost {
HostName = www.domain.tld, domain.tld
EnforceFirstHostname = yes
...
}


but it seems it does not work when Hiawatha is behind reverse-proxy or I do miss something in my setup?


Hugo Leisink
6 June 2016, 21:36
Use the EnforceFirstHostname at the reverse proxy, not at the backend webserver.
Gour
6 June 2016, 23:02
Ahh, so same thing as with http --> https redirection, with the exception that here I can solve problem at Haiwatha's side by using UrlToolkit rules.
This topic has been closed.