docker compose 安装halo和nginx之后使用ip:8090可以访问halo,但是配置文档里面的nginx之后使用域名访问一直报错502,nginx配置和官网描述一致
upstream halo {
server 127.0.0.1:8090;
}
server {
listen 80;
listen [::]:80;
server_name myweb.org;
client_max_body_size 51200m;
location / {
proxy_pass http://halo;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
本机 curl 127.0.0.1:8090 也能生成页面
我之后尝试了域名:8090也可以访问页面
请问nginx代理是哪块有问题吗?
docker compose nginx
nginx:
image: nginx:1.24.0
container_name: nginx
restart: on-failure:3
ports:
- "80:80"
volumes:
- /etc/localtime:/etc/localtime:ro
- /halo/nginx-conf/log/:/var/log/nginx
# 注意:如下挂载都是覆盖
- /halo/nginx-conf/nginx/html:/usr/share/nginx/html
- /halo/nginx-conf/nginx:/etc/nginx
这个和halo在一个docker compose文件里面追加的,会不会是halo网络影响的?
networks:
halo_network: