I'm trying to setup two virtual hosts for www.example.com, one for http and one for ssl (both are reverse proxies).
Binding {
BindingID = example
Port = 80
Interface = 2.2.2.2.2
}
Binding {
BindingID = examplessl
Port = 443
Interface = 2.2.2.2.2
SSLcertFile = example.pem
}
VirtualHost {
RequiredBinding = example
Hostname = www.example.com
ReverseProxy .* http://1.1.1.1/
WebsiteRoot = /var/www/example
AccessLogfile = /var/log/hiawatha/example/access.log
ErrorLogfile = /var/log/hiawatha/example/error.log
}
VirtualHost {
RequiredBinding = examplessl
Hostname = www.example.com
SSLcertFile = example.pem
RequireSSL = yes
ReverseProxy .* https://1.1.1.1/
WebsiteRoot = /var/www/example
AccessLogfile = /var/log/hiawatha/example/example-ssl.log
ErrorLogfile = /var/log/hiawatha/example/error.log
}
When a vistor hits www.example.com through SSL, Hiawatha should talk to the backend (1.1.1.1) though SSL. When the vistitor uses http, Hiawatha should talk HTTP with the backend as well.
When I'm trying the configuration above, Hiawatha shows the following error:
$ sudo /etc/init.d/hiawatha restart
Stopping webserver: Hiawatha
Warning: duplicate hostname 'www.example.com' found on line 115 in '/etc/hiawatha/hiawatha.conf'.
Starting webserver: Hiawatha
I've already tried it with a different hostname, eg. "example-ssl". But that doesn't work either (Hiawatha will start without any error messages but won't serve the website correctly -> serves default "Installation successful" page)
Hiawatha version: 9.6
Operating System: Debian 6.0.9
Any hints that would lead me to a solution for this problem?