diff --git a/README.md b/README.md index f0d253c2..9976f126 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,26 @@ # About this Repo -This is the Git repo of the official Docker image for [nginx](https://registry.hub.docker.com/_/nginx/). See the -Hub page for the full readme on how to use the Docker image and for information -regarding contributing and issues. +This is a fork of the Git repo of the official Docker image for [nginx](https://registry.hub.docker.com/_/nginx/) +(who knows better how to build nginx??). See the Hub page for the full readme on how to use the Docker image +and for information regarding contributing and issues. + +We (ProdataKey), just need it to compile nginx with native modules we need. We plan to maintain this in step with mainline. + +Ultimate goal would be to make adding a native code module to docker-nginx simply configurable and commit upstream. +Adding native modules is pretty painful right now: + +- add OS deps +- pull code +- modify nginx configure `--add-module /usr/src/modulepath`. +- modify nginx.conf + + +This must currently be done in each of the 8 individual $os/$os-perl branches of the repo (or just the one you use! mainline alpine here). + +Currently Added Modules: + +- [nginx-vts](https://github.com/vozlt/nginx-module-vts) + The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specificially in [docker-library/docs/nginx](https://github.com/docker-library/docs/tree/master/nginx). diff --git a/mainline/alpine/Dockerfile b/mainline/alpine/Dockerfile index c1b42a5c..3b83fc91 100644 --- a/mainline/alpine/Dockerfile +++ b/mainline/alpine/Dockerfile @@ -49,11 +49,13 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ --with-compat \ --with-file-aio \ --with-http_v2_module \ + --add-module=/usr/src/nginx-module-vts \ " \ && addgroup -S nginx \ && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ && apk add --no-cache --virtual .build-deps \ gcc \ + git \ libc-dev \ make \ openssl-dev \ @@ -84,6 +86,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ && mkdir -p /usr/src \ && tar -zxC /usr/src -f nginx.tar.gz \ && rm nginx.tar.gz \ + && git clone git://github.com/vozlt/nginx-module-vts.git /usr/src/nginx-module-vts \ && cd /usr/src/nginx-$NGINX_VERSION \ && ./configure $CONFIG --with-debug \ && make -j$(getconf _NPROCESSORS_ONLN) \ diff --git a/mainline/alpine/nginx.conf b/mainline/alpine/nginx.conf index e4bad8db..5b7ac159 100644 --- a/mainline/alpine/nginx.conf +++ b/mainline/alpine/nginx.conf @@ -15,6 +15,9 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; + # enable VTS module + vhost_traffic_status_zone; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; diff --git a/mainline/alpine/nginx.vh.default.conf b/mainline/alpine/nginx.vh.default.conf index 299c622a..63aa6b6b 100644 --- a/mainline/alpine/nginx.vh.default.conf +++ b/mainline/alpine/nginx.vh.default.conf @@ -2,6 +2,12 @@ server { listen 80; server_name localhost; + # expose VTS HTML output at http://localhost/status + location /status { + vhost_traffic_status_display; + vhost_traffic_status_display_format html; + } + #charset koi8-r; #access_log /var/log/nginx/host.access.log main;