diff --git a/rootfs/etc/nginx/conf.d/default.conf b/rootfs/etc/nginx/conf.d/default.conf index bc70e8d..f24cbaf 100644 --- a/rootfs/etc/nginx/conf.d/default.conf +++ b/rootfs/etc/nginx/conf.d/default.conf @@ -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; +} diff --git a/rootfs/etc/services.d/nginx/run b/rootfs/etc/services.d/nginx/run index afeeec1..830466c 100755 --- a/rootfs/etc/services.d/nginx/run +++ b/rootfs/etc/services.d/nginx/run @@ -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