openwrt使用Nginx 替代uhttpd
openwrt使用Nginx 替代uhttpd
进入openwrt终端执行下面命令,安装luci-nginx
1
opkg update && opkg install luci-nginx && opkg install luci-ssl-nginx
启动nginx并加入自动启动
1
2
3
chmod +x /etc/init.d/nginx
/etc/init.d/nginx enable
/etc/init.d/nginx start
在openwrt终端查看nginx配置文件名了
uci show nginx
-
nginx.global.uci_enable='true' nginx._lan=server nginx._lan.listen='80 default_server' '[::]:80 default_server' nginx._lan.server_name='op' nginx._lan.include='conf.d/*.locations' nginx._lan.access_log='off; # logd openwrt' nginx._ssl=server nginx._ssl.listen='443 ssl' '[::]:443 ssl' nginx._ssl.server_name='_ssl' nginx._ssl.include='conf.d/*.locations' nginx._ssl.ssl_certificate='/etc/nginx/conf.d/_lan.crt' nginx._ssl.ssl_certificate_key='/etc/nginx/conf.d/_lan.key' nginx._ssl.ssl_session_cache='shared:SSL:32k' nginx._ssl.ssl_session_timeout='64m' nginx._ssl.access_log='off; # logd openwrt'
-
删除指定的内容,比如
nginx._ssl.server_name='_ssl'
uci delete nginx._ssl.server_name='_ssl'
-
添加指定的内容,
nginx._ssl.ssl_session_timeout='64m'
uci add_list nginx._ssl.ssl_session_timeout='64m' uci add_list nginx._ssl.ssl_session_cache='shared:SSL:32k'
-
提交所有
uci
更改uci commit
-
重载 nginx 配置
service nginx reload