解决方法:修改 /etc/config/nginx OP接口文件 Nginx源配置文件如下:
config main global
option uci_enable 'true'
config server '_lan'
list listen '443 ssl default_server'
list listen '[::]:443 ssl default_server'
option server_name '_lan'
list include 'restrict_locally'
list include 'conf.d/*.locations'
option uci_manage_ssl 'self-signed'
option ssl_certificate '/etc/nginx/conf.d/_lan.crt'
option ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
option ssl_session_cache 'shared:SSL:32k'
option ssl_session_timeout '64m'
option access_log 'off; # logd openwrt'
config server '_redirect2ssl'
list listen '80'
list listen '[::]:80'
option server_name '_redirect2ssl'
option return '302 https://$host$request_uri'
关闭自生成证书,注释掉
option uci_manage_ssl 'self-signed'
并填入替换自己的证书路径,或者直接把 /etc/nginx/conf.d/_lan.crt 和 /etc/nginx/conf.d/_lan.key 改成自己申请的证书内容:
|