feat: docker nginx script.

This commit is contained in:
a.bouhuolia
2021-09-21 10:34:39 +02:00
parent 8691929516
commit 20f36284ad
6 changed files with 17719 additions and 9 deletions

View File

@@ -0,0 +1,18 @@
#!/bin/bash
for conf in /etc/nginx/templates/*.conf; do
mv $conf "/etc/nginx/sites-available/"$(basename $conf) > /dev/null
done
for template in /etc/nginx/templates/*.template; do
envsubst < $template > "/etc/nginx/sites-available/"$(basename $template)".conf"
done
if [[ "$NO_DEFAULT" = true ]]; then
rm /etc/nginx/sites-available/node.template.conf
rm /etc/nginx/sites-available/node-https.template.conf
else
if [[ "$WEB_SSL" = false ]]; then
rm /etc/nginx/sites-available/node-https.template.conf
fi
fi

View File

@@ -0,0 +1,13 @@
# environment variables
# WEB_REVERSE_PROXY_PORT ${WEB_REVERSE_PROXY_PORT}
server {
listen 443 default_server http2;
ssl on;
ssl_certificate /etc/ssl/cert1.pem;
ssl_certificate_key /etc/ssl/privkey1.pem;
location / {
proxy_pass http://node:${WEB_REVERSE_PROXY_PORT};
}
}

View File

@@ -0,0 +1,14 @@
# environment variables
# WEB_REVERSE_PROXY_PORT ${WEB_REVERSE_PROXY_PORT}
server {
listen 80 default_server;
location / {
proxy_pass http://node:${WEB_REVERSE_PROXY_PORT};
}
location /.well-known/acme-challenge/ {
root /var/www/letsencrypt/;
log_not_found off;
}
}