Skip to content

Commit 2037048

Browse files
committed
Merge pull request #7 from zalari/feature/additional_config
add feature to enable additional nginx config
2 parents 9aea720 + 25ad812 commit 2037048

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ MAINTAINER Evan Brown <[email protected]>
2121

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

24+
RUN mkdir -p /etc/nginx/extra-conf.d
25+
2426
WORKDIR /usr/src
2527

2628
ADD start.sh /usr/src/
2729
ADD nginx/nginx.conf /etc/nginx/
2830
ADD nginx/proxy*.conf /usr/src/
31+
ADD nginx/extra/*.conf /etc/nginx/extra-conf.d/
2932

3033
ENTRYPOINT ./start.sh

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,19 @@ To run an SSL termination proxy you must have an existing SSL certificate and ke
6464
-v /path/to/secrets/htpasswd:/etc/secrets/htpasswd \
6565
nginx-ssl-proxy
6666
```
67+
4. **Add additional nginx config**
68+
69+
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:
70+
71+
```shell
72+
docker run \
73+
-e ENABLE_SSL=true \
74+
-e TARGET_SERVICE=THE_ADDRESS_OR_HOST_YOU_ARE_PROXYING_TO \
75+
-v /path/to/secrets/cert.crt:/etc/secrets/proxycert \
76+
-v /path/to/secrets/key.pem:/etc/secrets/proxykey \
77+
-v /path/to/secrets/dhparam.pem:/etc/secrets/dhparam \
78+
-v /path/to/additional-nginx.conf:/etc/nginx/extra-conf.d/additional_proxy.conf \
79+
nginx-ssl-proxy
80+
```
81+
82+
That way it is possible to setup additional proxies or modifying the nginx configuration.

nginx/extra/empty-for-build.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#this file is intentionally left emtpy, because
2+
#otherwise docker-compose or the hub fails the build...

nginx/nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ http {
2828
#gzip on;
2929
client_max_body_size 20M;
3030
include /etc/nginx/conf.d/proxy.conf;
31+
32+
#additional config
33+
include /etc/nginx/extra-conf.d/*;
3134
}

0 commit comments

Comments
 (0)