Running and Verifying Nginx
You can check the started container, log in to the container, check the Nginx status, manually start Nginx, and exit the container to run and verify the Nginx container in Docker.
- Check the started container to ensure that the Nginx container is successfully started.
1docker ps - Log in to the container.The container name is specified when the container is created.
1docker exec -it nginx_1 bash
- Check whether the Nginx is started.
1ps -ef |grep nginx
- Optional: Start Nginx.
1/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
- Optional: Exit the container.
Do not run this command when the service is still running because the command will stop the running of the container.
1exit
Parent topic: Nginx Container Deployment Guide