summaryrefslogtreecommitdiff
path: root/images/router/service/nginx/run
diff options
context:
space:
mode:
authorSystem administrator2017-05-29 13:26:10 +0200
committerSystem administrator2017-05-29 13:26:10 +0200
commitbc5c44dd049bad3b007be48b3f8d90886d63c105 (patch)
treea381d989db2295f228f9bc95a774f0cc9aef4c40 /images/router/service/nginx/run
downloadserver-bc5c44dd049bad3b007be48b3f8d90886d63c105.tar.gz
server-bc5c44dd049bad3b007be48b3f8d90886d63c105.tar.xz
server-bc5c44dd049bad3b007be48b3f8d90886d63c105.zip
Initial commit
Diffstat (limited to 'images/router/service/nginx/run')
-rw-r--r--images/router/service/nginx/run16
1 files changed, 16 insertions, 0 deletions
diff --git a/images/router/service/nginx/run b/images/router/service/nginx/run
new file mode 100644
index 0000000..bfc6e24
--- /dev/null
+++ b/images/router/service/nginx/run
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+ln -sf /dev/stdout /var/log/nginx/access.log
+ln -sf /dev/stderr /var/log/nginx/error.log
+
+# nginx doesn't start without certificates,
+# so generate untrusted ones for startup
+if [ ! -d "/data/certs/tx0.co" ]; then
+ echo "Generating dummy certificates"
+ mkdir -p /data/certs/tx0.co
+ openssl req -x509 -nodes -batch -newkey rsa:512 -days 0 \
+ -keyout /data/certs/tx0.co/privkey.pem \
+ -out /data/certs/tx0.co/fullchain.pem
+fi
+
+exec nginx -g 'daemon off;'