Skip to content
KYND Dev

Nginx Docker container restart

DevOps, Server, Docker1 min read

1docker restart <container-id>

Docker doesn’t start the nginx service itself

We need to start nginx server by:

1docker exec -it <container-id> service nginx restart

The we can check whether the nginx service is running or not by:

1ducky@titan-rtx:~$ docker exec -it <container-id> ps -ef|grep nginx
2root 42 1 0 01:50 ? 00:00:00 nginx: master process /usr/sbin/
3nginx 70 42 0 01:50 ? 00:00:00 nginx: worker process
4nginx 71 42 0 01:50 ? 00:00:00 nginx: worker process
5nginx 72 42 0 01:50 ? 00:00:00 nginx: worker process
6nginx 73 42 0 01:50 ? 00:00:00 nginx: worker process

END