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_container_id> nginx -s reload