Score:1

Lighttpd - Redirect HTTPS 443 to HTTPS 123

in flag

I have HTTPS working for a local instance of Lighttpd.

But I'm wanting to redirect:

http://192.168.1.254 -> https://192.168.1.254:123
https://192.168.1.254 -> https://192.168.1.254:123

My config is below.

What I get ATM is https://192.168.1.254/:4430 which shows "This site can’t provide a secure connection" for both HTTP and HTTPS and I'm guess the extra / after 254 is the cause but I can't seem to figure it out.

server.modules += (
        "mod_openssl",
        "mod_alias"
)

setenv.add-environment = ("fqdn" => "true")

$SERVER["socket"] == ":4430" {
        ssl.engine = "enable"
        ssl.pemfile = "/etc/lighttpd/ssl/combined.pem"
        ssl.honor-cipher-order = "enable"
        ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
        ssl.use-sslv2 = "disable"
        ssl.use-sslv3 = "disable"
}

# Redirect HTTP to HTTPS 4430
$HTTP["scheme"] == "http" {
        $HTTP["host"] =~ ".*" {
                url.redirect = (".*" => "https://192.168.1.254:4430")
        }
}

# Redirect HTTPS to HTTPS 4430
$SERVER["socket"] == ":443" {
        $HTTP["host"] =~ ".*" {
                url.redirect = (".*" => "https://192.168.1.254:4430")
        }
}
cn flag
Bob
The problem in your current configuration is that it appears you want to run both http and https simultaneously on the same port, port 4430. You can't. (Other software can do protocol identification and separate for example incoming https and ssh connections on the same port and send them to different back-ends, but AFAIK lighthttpd can't.) - Also in the URL the format is `<protocol>://<host or IP>:<port>/<path>` where the port specification `:80` may be omitted for plain http resp. `:443` for https. Your `https://192.168.1.254/:4430` should probably be: `https://192.168.1.254:4430/`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.