合并 IPv4 和 IPv6 的 lighttpd 配置

合并 IPv4 和 IPv6 的 lighttpd 配置

我的 lighttpd.conf 包含以下几行:

$SERVER["socket"] == "188.40.236.66:443" {
   ssl.engine  = "enable" 
   ssl.ca-file = "/etc/lighttpd/ssl/startcom.ca.pem"
   ssl.pemfile = "/etc/lighttpd/ssl/www.unixforces.net.pem"
}   

$SERVER["socket"] == "[2a01:4f8:100:30a5:0:bc28:ec43:2]:443" {
   ssl.engine  = "enable"
   ssl.ca-file = "/etc/lighttpd/ssl/startcom.ca.pem"
   ssl.pemfile = "/etc/lighttpd/ssl/www.unixforces.net.pem"
}

是否可以将这两个块合并为一个?$SERVER["socket"]只允许==而不允许=~

答案1

$SERVER["socket"] == "188.40.236.66:443" {
   include "/etc/lighttpd/unixforces.net.conf"
}   

$SERVER["socket"] == "[2a01:4f8:100:30a5:0:bc28:ec43:2]:443" {
   include "/etc/lighttpd/unixforces.net.conf"
}

答案2

您也许可以避免以下情况:

$SERVER["socket"] == "[::]:80" { }
ssl.engine  = "enable" 
ssl.ca-file = "/etc/lighttpd/ssl/startcom.ca.pem"
ssl.pemfile = "/etc/lighttpd/ssl/www.unixforces.net.pem"

http://utcc.utoronto.ca/~cks/space/blog/linux/LighttpdIpv6

相关内容