summaryrefslogtreecommitdiff
path: root/images/router/service/nginx/run
blob: bfc6e24671567371adc72799bd1c2bb6efa5ca7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;'