Project

General

Profile

lighttpd.conf (host in http, 2 vhost in https on port 80)

Added by greeno over 9 years ago

Operating System (OS): Linux WRT (router OS)
Version of Lighttpd: 1.4.32-1

Hello. I need to configure lighttpd for one host to http and for two vhost to https. Webserver can only work on port 80 because I'm busy at 443 vpn service. Generally when i configure the SSL server on port 80, then when i type in the browser https://www.domain.pl:80, https://poczta.domain.pl:80, https://owncloud.domain.pl:80 server is running on https but i would like to configure it so that when i type in a web browser:
for the host: www.domain.pl it directs me to http://www.domain.pl (no ssl)
for vhost: poczta.domain.pl it directs me to https://poczta.domain.pl:80
for vhost: owncloud.domain.pl it directs me to https://owncloud.domain.pl:80

configuration to redirect sections have written this:

$HTTP["host"] !~ "^(poczta\.domain\.pl|owncloud\.domain\.pl)$" {
simple-vhost.server-root = "/opt/share/www/"
simple-vhost.default-host = "domain.pl"
simple-vhost.document-root = "/"
ssl.engine = "enable"
ssl.pemfile = "/jffs/ssl/server.pem" }
$HTTP["host"] == "poczta.domain.pl" {server.document-root = "/opt/share/www/poczta/"}
$HTTP["host"] == "owncloud.domain.pl" {server.document-root = "/opt/share/www/owncloud/"}

How to configure this script to work as i want?
My lighttpd.conf -> [[http://pastebin.com/wiBgANxf]]