收起左侧

使用nginx反向代理+watchcow应用生成桌面图标,可映射局域网服务。

0
回复
72
查看
[ 复制链接 ]

4

主题

4

回帖

0

牛值

江湖小虾

具体功能如标题,参考配置如下:
nginx docker-compose:

'''

services:
nginx:
container_name: nginx
image: nginx:latest
volumes:

  • /vol2/1000/docker/nginx/nginx.conf:/etc/nginx/nginx.conf
    restart: unless-stopped
    network_mode: "host"

#以下配置用于watchcow应用生成应用,创建桌面图标并加入飞牛官方内网穿透映射
labels:
watchcow.enable: "true"
watchcow.appname: "nginx"
watchcow.display_name: "nginx"

  watchcow.route.service_port: "81"
  watchcow.route.path: "/"
  watchcow.route.title: "route"
  
  watchcow.edge.service_port: "83"
  watchcow.edge.path: "/"
  watchcow.edge.title: "edge"
  

'''

nginx反向代理设置参考:

'''

events {
worker_connections 1024;
}

http {
server {
listen 8081;
listen [::]:8081;

    # 将所有请求代理到后端服务器
    location / {
        proxy_pass http://192.168.5.1;
        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_set_header X-Forwarded-Proto $scheme;
    }
}

}

'''

收藏
送赞 1
分享
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则