From 745d70fcd46a58b320d7bfd31a8709c5facac6aa Mon Sep 17 00:00:00 2001 From: Igor Diakonov Date: Thu, 16 Jan 2020 10:29:17 +0300 Subject: [PATCH] Added patched nginx-proxy --- nginx-proxy/Dockerfile | 11 +++++++++++ nginx-proxy/README.md | 3 +++ nginx-proxy/docker-compose.yml | 14 ++++++++++++++ nginx-proxy/vhost/whoami.local | 0 nginx-proxy/vhost/whoami.local_location | 4 ++++ 5 files changed, 32 insertions(+) create mode 100644 nginx-proxy/Dockerfile create mode 100644 nginx-proxy/README.md create mode 100644 nginx-proxy/docker-compose.yml create mode 100644 nginx-proxy/vhost/whoami.local create mode 100644 nginx-proxy/vhost/whoami.local_location diff --git a/nginx-proxy/Dockerfile b/nginx-proxy/Dockerfile new file mode 100644 index 0000000..dee7411 --- /dev/null +++ b/nginx-proxy/Dockerfile @@ -0,0 +1,11 @@ +FROM gcc as builder +RUN apt update && apt install make libpcre3-dev zlib1g-dev unzip git +WORKDIR /build +RUN wget -qO - http://nginx.org/download/nginx-1.17.5.tar.gz | tar zxfv - +RUN git clone https://github.com/openresty/headers-more-nginx-module +RUN cd nginx-1.17.5 && ./configure --prefix=/opt/nginx --with-compat --add-dynamic-module=/build/headers-more-nginx-module && make modules +RUN ls /build/nginx-1.17.5/objs/ + +FROM jwilder/nginx-proxy:alpine +COPY --from=builder /build/nginx-1.17.5/objs/ngx_http_headers_more_filter_module.so /usr/lib/nginx/modules/ +RUN sed -i "/user nginx;/aload_module modules/ngx_http_headers_more_filter_module.so;" /etc/nginx/nginx.conf diff --git a/nginx-proxy/README.md b/nginx-proxy/README.md new file mode 100644 index 0000000..4b003f9 --- /dev/null +++ b/nginx-proxy/README.md @@ -0,0 +1,3 @@ +This is a version of jwilder/nginx-proxy with 'headers more'-module installed. + +Example of usage is in `docker-compose.yml` and `/vhost/` diff --git a/nginx-proxy/docker-compose.yml b/nginx-proxy/docker-compose.yml new file mode 100644 index 0000000..1779315 --- /dev/null +++ b/nginx-proxy/docker-compose.yml @@ -0,0 +1,14 @@ +version: "2.0" +services: + nginx-proxy: + image: nginx-proxy:1.17-headers-more + ports: + - "80:80" + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - ./vhost:/etc/nginx/vhost.d:ro + + whoami: + image: jwilder/whoami + environment: + - VIRTUAL_HOST=whoami.local diff --git a/nginx-proxy/vhost/whoami.local b/nginx-proxy/vhost/whoami.local new file mode 100644 index 0000000..e69de29 diff --git a/nginx-proxy/vhost/whoami.local_location b/nginx-proxy/vhost/whoami.local_location new file mode 100644 index 0000000..2ad7111 --- /dev/null +++ b/nginx-proxy/vhost/whoami.local_location @@ -0,0 +1,4 @@ + more_set_headers 'Access-Control-Allow-Origin: http://whoami.local'; + more_set_headers 'Access-Control-Allow-Methods: GET'; + more_set_headers 'Access-Control-Allow-Headers: User-Agent,Keep-Alive,Content-Type'; + more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range';