2017-02-02 23:17:15 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-03-22 19:27:37 +01:00
|
|
|
if [ -z $ENABLE_CERTBOT ] || [ -f /certs/cert.pem ]
|
2017-02-12 16:32:46 +01:00
|
|
|
then
|
|
|
|
cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf
|
|
|
|
else
|
2017-03-22 19:26:38 +01:00
|
|
|
openssl req -newkey rsa:2048 -x509 -keyout /tmp/snakeoil.pem -out /tmp/snakeoil.pem -days 365 -nodes -subj "/C=NA/ST=None/L=None/O=None/CN=$DOMAIN"
|
2017-02-02 23:17:15 +01:00
|
|
|
cp /etc/nginx/nginx.conf.fallback /etc/nginx/nginx.conf
|
|
|
|
fi
|
|
|
|
|
2017-02-25 09:53:53 +01:00
|
|
|
if [ ! -r /etc/nginx/dhparam.pem ]; then
|
|
|
|
openssl dhparam -out /etc/nginx/dhparam.pem $NGINX_SSL_DHPARAM_BITS
|
|
|
|
fi
|
|
|
|
|
2017-02-02 23:17:15 +01:00
|
|
|
nginx -g 'daemon off;'
|