Skip to content

Commit

Permalink
Merge pull request #7 from zalari/feature/additional_config
Browse files Browse the repository at this point in the history
add feature to enable additional nginx config
  • Loading branch information
evandbrown committed Feb 17, 2016
2 parents 9aea720 + 25ad812 commit 2037048
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ MAINTAINER Evan Brown <evanbrown@google.com>

RUN rm /etc/nginx/conf.d/*.conf

RUN mkdir -p /etc/nginx/extra-conf.d

WORKDIR /usr/src

ADD start.sh /usr/src/
ADD nginx/nginx.conf /etc/nginx/
ADD nginx/proxy*.conf /usr/src/
ADD nginx/extra/*.conf /etc/nginx/extra-conf.d/

ENTRYPOINT ./start.sh
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,19 @@ To run an SSL termination proxy you must have an existing SSL certificate and ke
-v /path/to/secrets/htpasswd:/etc/secrets/htpasswd \
nginx-ssl-proxy
```
4. **Add additional nginx config**

All *.conf from [nginx/extra](nginx/extra) are added during *built* to **/etc/nginx/extra-conf.d** and get included on startup of the container. Using volumes you can overwrite them on *start* of the container:

```shell
docker run \
-e ENABLE_SSL=true \
-e TARGET_SERVICE=THE_ADDRESS_OR_HOST_YOU_ARE_PROXYING_TO \
-v /path/to/secrets/cert.crt:/etc/secrets/proxycert \
-v /path/to/secrets/key.pem:/etc/secrets/proxykey \
-v /path/to/secrets/dhparam.pem:/etc/secrets/dhparam \
-v /path/to/additional-nginx.conf:/etc/nginx/extra-conf.d/additional_proxy.conf \
nginx-ssl-proxy
```

That way it is possible to setup additional proxies or modifying the nginx configuration.
2 changes: 2 additions & 0 deletions nginx/extra/empty-for-build.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#this file is intentionally left emtpy, because
#otherwise docker-compose or the hub fails the build...
3 changes: 3 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ http {
#gzip on;
client_max_body_size 20M;
include /etc/nginx/conf.d/proxy.conf;

#additional config
include /etc/nginx/extra-conf.d/*;
}

0 comments on commit 2037048

Please sign in to comment.