lighttpd安装和配置https

bash 复制代码
apt install lighttpd
apt-get install php-cgi
lighttpd-enable-mod fastcgi fastcgi-php
service lighttpd force-reload

lighttpd配置https

复制代码
sudo nano /etc/lighttpd/lighttpd.conf

加入:

复制代码
server.modules += ("mod_openssl")
$SERVER["socket"] == "0.0.0.0:443" {
    ssl.engine = "enable"
    ssl.privkey= "/home/ubuntu/ssl/key.pem"
    ssl.pemfile= "/home/ubuntu/ssl/fullchain.pem"
    ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2") # (recommended to accept only TLSv1.2 and TLSv1.3)
    #ssl.ca-file= "/etc/lighttpd/certs/www.example.com/chain.pem" # (needed in $SERVER["socket"] before lighttpd 1.4.56 if ssl.pemfile in $HTTP["ho>
}

ssl.privkey私钥

ssl.pemfile公钥

重启lighttpd

为了重定向所有网络主机到它们的HTTPS安全访问方式,用以下内容取代之前的socket 80端口配置:

复制代码
server.modules += ( "mod_redirect" )
复制代码
$SERVER["socket"] == ":80" {
  $HTTP["host"] =~ ".*" {
    url.redirect = (".*" => "https://%0$0")
  }
}
相关推荐
ftpeak17 分钟前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
00后程序员张4 小时前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
weixin_4569042712 小时前
使用HTTPS 服务在浏览器端使用摄像头的方式解析
网络协议·http·https
不会叫的狼12 小时前
HTTPS + 域名 + 双向证书认证(下)
https
拷贝码农卡卡东1 天前
pre-commit run --all-files 报错:http.client.RemoteDisconnected
网络·网络协议·http
DoWhatUWant1 天前
域格YM310 X09移芯CAT1模组HTTPS连接服务器
服务器·网络协议·https
又菜又爱玩呜呜呜~1 天前
go使用反射获取http.Request参数到结构体
开发语言·http·golang
cellurw1 天前
Linux下C语言实现HTTP+SQLite3电子元器件查询系统
linux·c语言·http
希望20171 天前
Golang | http/server & Gin框架简述
http·golang·gin
全栈技术负责人1 天前
前端网络性能优化实践:从 HTTP 请求到 HTTPS 与 HTTP/2 升级
前端·网络·http