Dockerfile linksNginx-1.10.1 镜像集成模块列表:
Dockerfile文件的ARG参数可控制开启/关闭相应功能
ARG WITH_DEBUG=false
ARG WITH_NDK=false
ARG WITH_LUA=true
ARG WITH_PURGE=true
ARG WITH_HTTP_IMAGE_FILTER=false
ARG WITH_HTTP_XSLT=false
ARG WITH_PAGESPEED=true
ARG WITH_UPSTREAM_CHECK=true
运行nginx:
docker run --name nginx -d \
-p 80:80 --restart=always \
bjddd192/nginx:1.10.1
或者您可以使用示例docker-compose.yml文件启动容器
自定义您的配置文件覆盖容器默认的/etc/nginx/nginx.conf配置
docker run --name nginx -d \
-v /some/nginx.conf:/etc/nginx/nginx.conf:ro \
bjddd192/nginx:1.10.1
挂载您自己的sites-enabled目录到/etx/nginx/sites-enabled
docker run --name nginx -d \
-v /some/nginx.conf:/etc/nginx/nginx.conf:ro \
-v /srv/docker/nginx/sites-enabled:/etc/nginx/sites-enabled \
bjddd192/nginx:1.10.1
重新加载的NGINX配置使用kill -s HUP发送到容器上
docker kill -s HUP nginx
访问Nginx日志位于/var/log/nginx
docker exec -it nginx tail -f /var/log/nginx/access.log
docker run -p 80:80 --name nginx -d \
bjddd192/nginx:1.10.1
nginx -c /etc/nginx/test.conf
先访问http://localhost/index.html ,然后再次访问http://localhost/purge/index.html会看到效果
其实访问http://localhost/index.html地址已经使用反向代理到http://localhost:8045/index.html页面上
访问http://localhost/lua页面将会显示hello lua.
访问http://localhost/status1页面将会显示stub状态
访问http://localhost/status2页面将会显示upstream状态
Content type
Image
Digest
Size
138.1 MB
Last updated
about 5 years ago
docker pull bjddd192/nginx:1.17.10-0602