Merge pull request #23 from jlesage/default-https-site

Added default HTTPs site.
This commit is contained in:
jc21 2018-11-05 09:36:29 +10:00 committed by GitHub
commit 9b852f01e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -36,3 +36,17 @@ server {
root /var/www/html;
}
}
# Default 443 Host
server {
listen 443 ssl default;
server_name localhost;
access_log /data/logs/default.log proxy;
ssl_certificate /data/nginx/dummycert.pem;
ssl_certificate_key /data/nginx/dummykey.pem;
ssl_ciphers aNULL;
return 444;
}

View File

@ -21,5 +21,19 @@ chown root /tmp/nginx
# Dynamically generate resolvers file
echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /etc/nginx/conf.d/include/resolvers.conf
# Generate dummy self-signed certificate.
if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]
then
openssl req \
-new \
-newkey rsa:2048 \
-days 3650 \
-nodes \
-x509 \
-subj '/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost' \
-keyout /data/nginx/dummykey.pem \
-out /data/nginx/dummycert.pem
fi
# Run
exec nginx