使用 Docker 安装 #
[[Docker安装与配置指南]]
docker run \
--restart=always \
-it \
--name ns \
-p 80:80 \
-p 443:443 \
-v ~/nginx/conf/nginx.conf:/etc/nginx/nginx.conf \
-v ~/nginx/log:/var/log/nginx \
-v ~/nginx/html:/usr/share/nginx/html \
-v ~/nginx/cert:/opt/cert \
-d nginx:latest
加载配置文件 #
docker exec -it {container_name} nginx -s reload
查看并检测配置文件 #
nginx -t