Sign inSign up

bjddd192/nginx

By bjddd192

•Updated about 5 years ago

docker pull bjddd192/nginx:1.10.1

Image
0

326

bjddd192/nginx repository overview

⁠Introduction

Nginx-1.10.1 镜像集成模块列表:

  • pagespeed
  • luaJIT
  • lua-nginx-module
  • nginx_upstream_check_module
  • nginx_cache_purge_module
  • nginx_devel_kit

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

⁠Quickstart

运行nginx:

docker run --name nginx -d \
  -p 80:80 --restart=always \
  bjddd192/nginx:1.10.1

或者您可以使用示例docker-compose.yml⁠文件启动容器

⁠Configuration

自定义您的配置文件覆盖容器默认的/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

⁠Logs

访问Nginx日志位于/var/log/nginx

docker exec -it nginx tail -f /var/log/nginx/access.log

⁠Test

⁠执行以下命令启动容器
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状态

Tag summary

Content type

Image

Digest

Size

138.1 MB

Last updated

about 5 years ago

docker pull bjddd192/nginx:1.17.10-0602