Tips when setup Nginx Docker

2018-07-15  本文已影响0人  凸大愚若智凸

Default configuration file inside Nginx docker is located under /etc/nginx/conf.d, named default.conf.
Be aware that the file name is a little bit different from default one on Ubuntu. On Ubuntu, it's located and named /etc/nginx/sites-available/default, while on Nginx docker it's located and named /etc/nginx/conf.d/default.conf.

docker run --name <nginx-container> -v /etc/nginx/sites-available/:/etc/nginx/conf.d -d nginx
docker exec -it <nginx-container> bash
apt update
apt install iputils-ping
docker exec -it <nginx-container> bash
ping <host-ip>
上一篇下一篇

猜你喜欢

热点阅读