Forum

Server String when in reverseproxy and documentroot

Epe
27 April 2014, 23:51
hi, today Im testing hiawatha in reverse proxy, and I have two questions:

1- unless I add WebsiteRoot to the virtualhost, the server doesnt
Starting webserver: A WebsiteRoot is missing for www.ecualinux.com in hiawatha.conf

2- I would like to have a reverseproxy for all websites pointing to the IP... Im trying Hostname *.. I also tried Hostname www.ecualinux.com, * (because I readed the initial hostname should not contains *) but it is not working the way I expect.

3- I have the reverseproxy working, but when I extract the headers, I get Server: apache, instead of hiawatha.

here is the configuration as of now (I actually need an * because there are several domain names not only these):
VirtualHost {
Hostname = www.ecualinux.com, www.ernestoperez.com, ernestoperez.com, *.ecualinux.com, ecualinux.com, www.ecualug.org, ecualug.org
WebsiteRoot = /var/www/ecualinux
ReverseProxy .* http://127.0.0.1:80/ keep-alive
}

as you can see here, instead of hiawatha, I get Server: apache:
[eperez@laptop ~]$ curl -s --head www.ernestoperez.com
HTTP/1.1 301 Moved Permanently
Date: Sun, 27 Apr 2014 21:44:47 GMT
Server: Apache
Set-Cookie: bb2_screener_=1398635087+186.46.176.104+186.46.176.104; path=/
X-Pingback: http://ernestoperez.com/xmlrpc.php
Location: http://ernestoperez.com/
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked




Hiawatha version: 9.4
Operating System: CentOS-6
Mustafa Ramadhan
28 April 2014, 03:14
Epe
28 April 2014, 05:13
good.. and questions number 1 and number 2?
Hugo Leisink
28 April 2014, 06:49
1:The DocumentRoot is required because it's hard to detect if there is a catch-all rewrite rule or reverse proxy. Hiawatha needs to know where to look for files.

2: Don't use a virtual hosts, but configure the reverse proxy in the default host.

3: Of course, that header is part of the response.
Epe
30 April 2014, 19:03
Sorry, regarding question 1: I dont get it.. if I configure a reverse proxy, then it is a reverse proxy.. why to look for something in a directory?
Hugo Leisink
30 April 2014, 20:05
It is possible to setup a reverse proxy for certain URLs. In that case, Hiawatha needs to know where to look for the files that should not be reverse proxied. It is very tricky to detect if a reverse proxy setup will never result in a request for a local file. Just to be sure, Hiawatha requires a DocumentRoot setting.
This topic has been closed.