search

Home  >  Q&A  >  body text

python - pyspider使用docker 集群部署 nginx设置问题

按照《demo.pyspider.org 部署经验》这篇文章内容,进行分布式部署,使用mysql数据。其中所有docker服务都已经启动,但是由于不知道nginx如何设置,一直访问不起来,原文中也没提到ngix设置。

docker如下:


请大神告知ngix如何设置。

阿神阿神2802 days ago870

reply all(2)I'll reply

  • PHP中文网

    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;
        }
    }

    reply
    0
  • ringa_lee

    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"
          
          

    reply
    0
  • Cancelreply