File tree 4 files changed +18
-24
lines changed
4 files changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ COPY services.d/nginx/* /etc/services.d/nginx/
11
11
COPY services.d/simp_le/* /etc/services.d/simp_le/
12
12
COPY nginx.conf /etc/nginx/
13
13
COPY proxy.conf /etc/nginx/conf.d/default.conf
14
- COPY get-certificate.sh /etc/cont-init.d/
15
14
COPY dhparams.pem /etc/nginx/
16
15
17
16
RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
@@ -48,7 +47,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \
48
47
&& rm ips-v6 ips-v4 \
49
48
&& echo "---> Fixing permissions" \
50
49
&& mkdir /certs \
51
- && chmod +x /etc/services.d/*/* /etc/cont-init.d/get-certificate.sh \
50
+ && chmod +x /etc/services.d/*/* \
52
51
&& echo "---> Cleaning up" \
53
52
&& rm -Rf /var/lib/apt /var/cache/apt
54
53
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
upstream origin {
2
- server ${UPSTREAM:-upstream };
2
+ server ${UPSTREAM:-127.0.0.1 };
3
3
}
4
4
5
5
server {
@@ -11,7 +11,7 @@ server {
11
11
# Performance + Privacy improvements
12
12
ssl_stapling on;
13
13
ssl_stapling_verify on;
14
- ssl_trusted_certificate /certs/server-fullchain .pem;
14
+ ssl_trusted_certificate /certs/server-cert .pem;
15
15
resolver 8.8.8.8 208.67.222.222 valid=300s;
16
16
resolver_timeout 5s;
17
17
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
+ if [ -z "$SERVERNAME" ]; then
4
+ echo "ERROR: Server name must be specified..."
5
+ exit 1
6
+ fi
7
+
8
+ echo Waiting for Nginx to come up...
9
+ until wget -T 1 --tries 0 http://127.0.0.1/; do
10
+ sleep 1s
11
+ done
12
+ echo Nginx has arrived.
13
+
3
14
cd /certs
4
15
5
16
while true; do
6
17
7
- BIGSLEEP="$(( 360 + $(($RANDOM % 360)) ))"m # 6-12 hours
8
-
9
- if /etc/cont-init.d/get-certificate.sh; then
18
+ if simp_le --cert_key_size 2048 -d $SERVERNAME:/usr/share/nginx/html -f key.pem -f cert.pem -f fullchain.pem; then
19
+ cp key.pem server-key.pem
20
+ cp fullchain.pem server-cert.pem # Nginx needs the intermediate certificate along with the server cert.
10
21
nginx -s reload
11
22
else
23
+ BIGSLEEP="$(( 360 + $(($RANDOM % 360)) ))"m # 6-12 hours
12
24
sleep $BIGSLEEP
13
25
fi
14
26
You can’t perform that action at this time.
0 commit comments