首页 > 系统相关 >openwrt nginx ssl 增加端口,互联网访问

openwrt nginx ssl 增加端口,互联网访问

时间:2023-09-27 14:14:34浏览次数:44  
标签:etc ssl 导入 conf nginx openwrt

虽然已经会配置nginx了

但是在openwrt上配置neginx,并允许wan访问,还是需要改一些东西的。

尤其是几个运营商封端口。80,8080,10080,443均已沦陷,或即将沦陷。

openwrt 的nginx - 上官飞鸿 - 博客园 (cnblogs.com)

所以我将使用10443来配置自己的路由器web wan管理。

按上一篇博文的介绍。

将新的*.conf文件放入/etc/nginx/conf.d 即可

#/etc/nginx/conf.d/wan_web.conf 其实是复制自/etc/nginx/uci.conf其中一段
server { listen [::]:10443 ssl default_server; #监听IPV6的10443 include restrict_locally; #ip白名单 include conf.d/*.locations; #专用路径的解析 ssl_certificate /etc/nginx/conf.d/_lan.crt; #ssl证书相关 ssl_certificate_key /etc/nginx/conf.d/_lan.key; #ssl证书相关 ssl_session_cache shared:SSL:32k; #ssl证书相关 ssl_session_timeout 64m; #ssl证书相关 access_log off; # logd openwrt; #关闭日志 }

 注意路径问题,我就这里卡了1小时。

 在openwrt的nginx中,默认配置文件是:/etc/nginx/uci.conf

 在这个文件中有这么一句:

…………
    include conf.d/*.conf;
}

就是这句,包括了我们在conf.d/*.conf

然后在我们自己的wan_web.conf中,需要导入luci.locations,被写成了include conf.d/*.locations;

由于最早的导入是从/etc/nginx/uci.conf这个文件开始的,所以后续导入的文件(wan_web.conf)导入文件,也算是从/etc/nginx/uci.conf文件导入,所以路径看起来似乎不对,其实是对的。

我是在手动强制导入luci.locations,不导入*.locations时才发现这个问题。

特此记录。

标签:etc,ssl,导入,conf,nginx,openwrt
From: https://www.cnblogs.com/jackadam/p/17732561.html

相关文章

  • nginx访问报错“maximum number of descriptors supported by select() is 1024 while
    1、问题背景 项目:一个人力的系统,主要用于考勤打卡环境:windowsservernginx版本:1.22 问题说明:当早上访问人数增加的时候,就会出现nginx的异常nginx的后台报错日志:maximumnumberofdescriptorssupportedbyselect()is1024whileconnectingtoupstream  ......
  • Nginx配置后无法解析PHP问题
    Nginx配置后无法解析PHP问题#Formoreinformationonconfiguration,see:#  *OfficialEnglishDocumentation:http://nginx.org/en/docs/#  *OfficialRussianDocumentation:http://nginx.org/ru/docs/ usernginx;worker_processesauto;error_log/var/l......
  • gunicorn dango nginx 实现同时处理并发请求
    项目是采用 gunicorndangonginx方式部署的。gunicorn.py采用如下方式配置,workers=1bind='0.0.0.0:8000'backlog=2048timeout=6000keepalive=6000errorlog='../error.log'loglevel='info'logFile='../sys.log'accesslog=......
  • 在CentOS系统中安装Nginx
    以下是在CentOS系统中安装Nginx的步骤:1.更新系统软件包:sudoyumupdate2.安装EPEL存储库: sudoyuminstallepel-release3.安装Nginx:sudoyuminstallnginx4.启动Nginx服务:sudosystemctlstartnginx5.设置Nginx服务自启动:sudosystemctlenablenginx6.验证Nginx......
  • Pc 部署 Openwrt
    准备:WinPEphysdiskwriteOpenWrt固件WinpeWinpe操作DiskGenius删除磁盘分区写入镜像到磁盘#打开cmd切换到u盘分区u:#将img镜像写入磁盘physdiskwrite-uopenwrt.imgwrt操作##查看默认ip地址ipadd##设置内网ipucisetnetwork.lan.ipaddr=192.168.0.254ucicommitnet......
  • Windos Nginx开发准备
    1.下载打开nginx.conf#Windows修改第一处log_formatmain'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''&qu......
  • nginx日志分析: 每小时请求量最高的IP
    按小时来统计,当前指定日志的每小时最高流量的前10个IP,并显示出请求的状态码.nginx.conf中配置的日志格式为:  log_format main '$remote_addr-$remote_user[$time_local]"$request"'           '$status$body_bytes_sent"$http_refere......
  • win下编译libcurl x86静态库 (附带ssl)
     VisualStudio版本: 克隆libcurl项目:gitclonehttps://github.com/curl/curl.git添加依赖(ssl):在拷贝的项目下添加deps目录: 在deps下创建lib和include目录: 关于编译openssl参考:https://www.cnblogs.com/laremehpe/p/17712109.html将openssl下的include下的open......
  • ssl连接服务端报错
     客户端报错:SSLhandshakefailedwithbaidumy:8000:certificateverifyfailed服务端报错:SSLhandshakefailed:sslv3alertcertificateexpired原因:所发的server-cert.pem过期了,需要重新扮发新证书,用openssl发自己的证书,默认有效期1个月。 使用openssl扮发ca证书命令......
  • nginx-clojure nginx 1.25.2 版本docker 镜像
    主要是测试下nginx-clojure有nginx1.25.2的兼容性,顺便基于原有的构建弄一个方便测试的debug版本的镜像构建构建命令实际结合业务修改下./configure--prefix=--sbin-path=nginx--conf-path=conf/nginx.conf--error-log-path=logs/error.log--http-log-path......