Browse Source

Added patched nginx-proxy

pull/118/head
Igor Diakonov 5 years ago
parent
commit
745d70fcd4
  1. 11
      nginx-proxy/Dockerfile
  2. 3
      nginx-proxy/README.md
  3. 14
      nginx-proxy/docker-compose.yml
  4. 0
      nginx-proxy/vhost/whoami.local
  5. 4
      nginx-proxy/vhost/whoami.local_location

11
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

3
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/`

14
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

0
nginx-proxy/vhost/whoami.local

4
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';
Loading…
Cancel
Save