找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1464|回复: 8

openwrt 里的 nginx管理器 使用疑问

[复制链接]
发表于 2023-1-27 13:21 | 显示全部楼层 |阅读模式



需求:从外网访问https://XXX.XXXX.top:1002 能让nginx帮我转到http://192.168.100.140:1002
https://XXX.XXXX.top:1002http://192.168.100.140:1002


有大佬能帮我看看 我配置文件有写对吗
在nginx管理器的MSG1500配置文件内容如下:

Server {
listen 80;
listen 443;
servername XXX.XXXX.top;
    location /  {
   proxypass http://192.168.100.140:1002;
       if (scheme = http) {
       return 301 https://servername$request_uri;
  }
}
}

除了上面的配置文件,还需要设置什么其他的东西吗? 比如防火墙出入站规则?端口转发?


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2023-1-27 14:01 | 显示全部楼层
nginx已经配置好证书了的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2023-1-27 16:24 | 显示全部楼层
其实我就是想  openwrt使用nginx 实现家中任意设备不安装证书也能使用https访问
不想用安装Docker然后安装nginx proxy manger(听说效率低?)
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-1-27 22:48 | 显示全部楼层
安下面配置,路径改一下,然后防火墙里,添加端口转发,1002 转发到路由本机IP的 1002

server {
        listen 1002 ssl;
        server_name XXX.XXXX.top;
        ssl_certificate 证书路径;
        ssl_certificate_key 密钥路径;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        location / {
                proxy_pass http://192.168.100.140:1002;
                proxy_redirect off;
                proxy_set_header        Host    $host;
                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
                proxy_max_temp_file_size 0;
                proxy_connect_timeout 90;
                proxy_send_timeout 90;
                proxy_read_timeout 90;
                proxy_buffer_size 64k;
                proxy_buffers 32 32k;
                proxy_busy_buffers_size 128k;
                proxy_temp_file_write_size 128k;
    }
}

点评

谢谢老哥  详情 回复 发表于 2023-1-28 09:12
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2023-1-28 09:12 | 显示全部楼层
jjit 发表于 2023-1-27 22:48
安下面配置,路径改一下,然后防火墙里,添加端口转发,1002 转发到路由本机IP的 1002

server {

谢谢老哥   
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-2-1 08:09 | 显示全部楼层
可以,你这叫反向代理。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-2-1 09:39 | 显示全部楼层
我的nginx天天被各种肉鸡扫描,真是蛋疼

点评

怎么查的?我也想看下有没有被扫  详情 回复 发表于 2023-2-1 10:29
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2023-2-1 10:29 | 显示全部楼层
lcsuper 发表于 2023-2-1 09:39
我的nginx天天被各种肉鸡扫描,真是蛋疼

怎么查的?我也想看下有没有被扫

点评

nginx有个access.log日志文件,只要是/0x30/0x15这样的请求的都是注入扫描  详情 回复 发表于 2023-2-1 10:47
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2023-2-1 10:47 | 显示全部楼层
mojinhai 发表于 2023-2-1 10:29
怎么查的?我也想看下有没有被扫

nginx有个access.log日志文件,只要是/0x30/0x15这样的请求的都是注入扫描
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 05:20

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表