按照《demo.pyspider.org 部署经验》这篇文章内容,进行分布式部署,使用mysql数据。其中所有docker服务都已经启动,但是由于不知道nginx如何设置,一直访问不起来,原文中也没提到ngix设置。
docker如下:
请大神告知ngix如何设置。
PHP中文网2017-04-18 09:15:13
upstream backend {
server haproxy:80;
}
server {
listen 80;
server_name demo.pyspider.org;
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
location / {
proxy_pass http://backend;
}
}
ringa_lee2017-04-18 09:15:13
If there is no need for load balancing, just kill nginx directly, just remember to map the webui port in the docker-compose file
ports:
- "5000:5000"