File tree 4 files changed +13
-2
lines changed
4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ MAINTAINER codedevote
3
3
4
4
# Set this to rancher url via docker option '-e RANCHER_URL=myrancher.example.org'
5
5
ENV RANCHER_URL localhost
6
+ ENV RANCHER_PORT 8080
7
+ ENV RANCHER_CONTAINER_NAME rancher
6
8
7
9
# add nginx config for rancher server
8
10
ADD rancher.conf /etc/nginx/conf.d/rancher.conf
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ View in GitHub [codedevote/docker-nginx-ssl-proxy-rancher](https://github.com/co
19
19
* __ RANCHER\_ URL__
20
20
* default: localhost
21
21
22
+ * __ RANCHER\_ PORT__
23
+ * default: 8080
24
+
25
+ * __ RANCHER\_ CONTAINER_NAME__
26
+ * default: rancher
27
+
28
+
22
29
## Running codedevote/nginx-ssl-proxy-rancher container
23
30
All the information on running the base image also applies to this container.
24
31
Original file line number Diff line number Diff line change @@ -32,14 +32,16 @@ if [ ! -e "/etc/nginx/external/cert.pem" ] || [ ! -e "/etc/nginx/external/key.pe
32
32
then
33
33
echo " >> generating self signed cert"
34
34
openssl req -x509 -newkey rsa:4086 \
35
- -subj " /C=XX/ST=XXXX/L=XXXX/O=XXXX/CN=localhost " \
35
+ -subj " /C=XX/ST=XXXX/L=XXXX/O=XXXX/CN=$RANCHER_URL " \
36
36
-keyout " /etc/nginx/external/key.pem" \
37
37
-out " /etc/nginx/external/cert.pem" \
38
38
-days 3650 -nodes -sha256
39
39
fi
40
40
41
41
echo " >> setting rancher url to $RANCHER_URL "
42
42
sed -i " s/\$ {RANCHER_URL}/$RANCHER_URL /" /etc/nginx/conf.d/rancher.conf
43
+ sed -i " s/\$ {RANCHER_PORT}/$RANCHER_PORT /" /etc/nginx/conf.d/rancher.conf
44
+ sed -i " s/\$ {RANCHER_CONTAINER_NAME}/$RANCHER_CONTAINER_NAME /" /etc/nginx/conf.d/rancher.conf
43
45
44
46
echo " >> copy /etc/nginx/external/*.conf files to /etc/nginx/conf.d/"
45
47
cp /etc/nginx/external/* .conf /etc/nginx/conf.d/ 2> /dev/null > /dev/null
Original file line number Diff line number Diff line change 2
2
# terminates ssl at the proxy and proxy passes to rancher server
3
3
4
4
upstream rancherserver {
5
- server rancher:8080 ;
5
+ server ${RANCHER_CONTAINER_NAME}:${RANCHER_PORT} ;
6
6
}
7
7
8
8
server {
You can’t perform that action at this time.
0 commit comments