具体功能如标题,参考配置如下:
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;
}
}
}
'''