restart nginx container when upstream servers is updated

前端 未结 4 893
情歌与酒
情歌与酒 2020-12-24 13:48

I want to add/remove servers in my nginx running inside a docker container

I use ADD command in Dockerfile to add my nginx.conf to /etc/nginx dir.

#          


        
4条回答
  •  轮回少年
    2020-12-24 14:29

    restarting the container is not advisable when you initialize Docker Swarm because it may remove the nginx service. So if you need an alternative aside docker restart; You can go inside the container and just run nginx -s reload

    For example, in docker env, if you have the container named nginx

    docker exec  nginx -s reload
    

提交回复
热议问题