File tree Expand file tree Collapse file tree 3 files changed +12
-18
lines changed Expand file tree Collapse file tree 3 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -8,21 +8,17 @@ LABEL org.label-schema.url="https://devicehive.com" \
8
8
org.label-schema.name="devicehive-proxy" \
9
9
org.label-schema.version="$DH_PROXY_VERSION"
10
10
11
- RUN apt-get update && \
12
- apt-get install -y openssl && \
13
- rm -rf /var/lib/apt/lists/*
14
-
15
11
ADD nginx.conf /etc/nginx/nginx.conf
16
12
17
- ADD server.d/ /etc/nginx/server.d/
18
13
ADD upstream.d/ /etc/nginx/upstream.d/
19
14
ADD location.d/ /etc/nginx/location.d/
15
+ ADD server-available/ /etc/nginx/server-available/
20
16
ADD upstreams-available/ /etc/nginx/upstreams-available/
21
17
ADD locations-available/ /etc/nginx/locations-available/
22
18
23
19
ADD admin/ /opt/devicehive/admin/
24
20
25
- RUN mkdir /etc/nginx/stream.d/
21
+ RUN mkdir /etc/nginx/stream.d/ /etc/nginx/server.d/
26
22
27
23
COPY proxy-start.sh /opt/devicehive/
28
24
Original file line number Diff line number Diff line change 3
3
set -e
4
4
set -x
5
5
6
- if [ ! -f /etc/ssl/dhparam.pem ]
6
+ if [ -f /etc/ssl/dhparam.pem -a -f /etc/ssl/ssl_certificate -a -f /etc/ssl/ssl_certificate_key ]
7
7
then
8
- # NOTE: we only need this if we want to support non-PFS ciphers
9
- openssl dhparam -out /etc/ssl/dhparam.pem 2048
10
- fi
11
-
12
- if [ ! -f /etc/ssl/ssl_certificate -o ! -f /etc/ssl/ssl_certificate_key ]
13
- then
14
- openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/ssl_certificate_key -out /etc/ssl/ssl_certificate -days 365 -nodes -subj ' /CN=localhost' -sha256
8
+ echo " Found TLS certificate and key. Enabling TLS in nginx."
9
+ ln -sf /etc/nginx/server-available/ssl-parameters.conf /etc/nginx/server.d/
10
+ else
11
+ echo " TLS certificate, key or DH parameters file not found. Starting nginx without TLS support."
15
12
fi
16
13
17
14
echo resolver $( awk ' BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) " ;" > /etc/nginx/resolvers.conf
18
15
19
16
# Enable dh_plugin configuration only if dh_plugin resolvable
20
17
getent hosts dh_plugin \
21
- && ln -s /etc/nginx/upstreams-available/plugin_upstream.conf /etc/nginx/upstream.d/plugin_upstream.conf \
22
- && ln -s /etc/nginx/locations-available/plugin_location.conf /etc/nginx/location.d/plugin_location.conf
18
+ && ln -sf /etc/nginx/upstreams-available/plugin_upstream.conf /etc/nginx/upstream.d/ \
19
+ && ln -sf /etc/nginx/locations-available/plugin_location.conf /etc/nginx/location.d/
23
20
24
21
# Enable wsproxyext configuration only if wsproxyext resolvable
25
22
getent hosts wsproxyext \
26
- && ln -s /etc/nginx/upstreams-available/wsproxyext.conf /etc/nginx/upstream.d/wsproxyext.conf \
27
- && ln -s /etc/nginx/locations-available/wsproxyext.conf /etc/nginx/location.d/wsproxyext.conf
23
+ && ln -sf /etc/nginx/upstreams-available/wsproxyext.conf /etc/nginx/upstream.d/ \
24
+ && ln -sf /etc/nginx/locations-available/wsproxyext.conf /etc/nginx/location.d/
28
25
29
26
nginx
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ ssl_session_cache shared:SSL:50m;
8
8
ssl_session_tickets off;
9
9
10
10
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
11
+ # NOTE: we only need this if we want to support non-PFS ciphers
11
12
ssl_dhparam /etc/ssl/dhparam.pem;
12
13
13
14
# intermediate configuration. tweak to your needs.
You can’t perform that action at this time.
0 commit comments