Enable https and --preload on the admin to improve letsencrypt support

This commit is contained in:
Pierre Jaury
2017-02-12 16:32:46 +01:00
parent a1845dc05f
commit be5562620e
5 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,11 @@
#!/bin/sh
if [[ ! -z ENABLE_CERTBOT && ! -f /certs/cert.pem ]]; then
if [[ -z ENABLE_CERTBOT || -f /certs/cert.pem ]]
then
cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf
else
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"
cp /etc/nginx/nginx.conf.fallback /etc/nginx/nginx.conf
fi