Carsomyr 发表于 2023-5-19 21:07

记录一下qnap 放在nginx后面 使用反带访问

    核心代码

location / {
      set $upstream_port 5001;
      set $upstream_protohttps;
      proxy_pass $upstream_proto://192.168.6.96:$upstream_port;
                proxy_pass_header Authorization;
                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_http_version 1.1;
                proxy_set_header Connection "";
                proxy_buffering off;
                client_max_body_size 0;
                proxy_read_timeout 36000s;
                proxy_redirect off;
                proxy_hide_header Upgrade;
}

20has 发表于 2023-8-2 15:28

本帖最后由 20has 于 2023-8-2 15:30 编辑

做反向代理的核心代码:
            if ( $host = 'qnap.xxxx.xxx' ) {
                proxy_pass http://192.168.6.96:5000;
            }
主要就是 proxy_pass 就行了把 其它的都默认也行呀

zsj 发表于 2023-10-26 13:17

请教用npm怎么反代qnap?

Carsomyr 发表于 2023-10-27 15:31

zsj 发表于 2023-10-26 13:17
请教用npm怎么反代qnap?

默认配置,开ws就行了https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif

ft3980802 发表于 2023-10-27 17:56

本帖最后由 ft3980802 于 2023-10-27 18:36 编辑

多谢老铁,解惑了很久的问题
还想请教一下,openwrt如何在ngm反代能访问?端口应该是80,但还是不行

Carsomyr 发表于 2023-11-1 08:35

ft3980802 发表于 2023-10-27 17:56
多谢老铁,解惑了很久的问题
还想请教一下,openwrt如何在ngm反代能访问?端口应该是80,但还是不行 ...

不清楚你的配置,这个按理说毫无难度啊 ,你自己再检查看看https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif
页: [1]
查看完整版本: 记录一下qnap 放在nginx后面 使用反带访问