update nginx config

pull/21891/head
ytqh 1 year ago
parent 944207f072
commit fce629c201

@ -0,0 +1,24 @@
# Configuration for langbot.lefeng.school subdomain
server {
listen ${NGINX_PORT};
server_name langbot.${NGINX_SERVER_NAME};
# Main langbot service
location / {
proxy_pass http://host.docker.internal:5300;
include proxy.conf;
}
# Callback endpoint
location /callback {
proxy_pass http://host.docker.internal:2290;
include proxy.conf;
}
# placeholder for acme challenge location
${ACME_CHALLENGE_LOCATION}
# placeholder for https config defined in https.conf.template
${HTTPS_CONFIG}
}

@ -19,8 +19,6 @@ if [ "${NGINX_HTTPS_ENABLED}" = "true" ]; then
# set the HTTPS_CONFIG environment variable to the content of the https.conf.template # set the HTTPS_CONFIG environment variable to the content of the https.conf.template
HTTPS_CONFIG=$(envsubst < /etc/nginx/https.conf.template) HTTPS_CONFIG=$(envsubst < /etc/nginx/https.conf.template)
export HTTPS_CONFIG export HTTPS_CONFIG
# Substitute the HTTPS_CONFIG in the default.conf.template with content from https.conf.template
envsubst '${HTTPS_CONFIG}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
fi fi
export HTTPS_CONFIG export HTTPS_CONFIG
@ -36,7 +34,13 @@ env_vars=$(printenv | cut -d= -f1 | sed 's/^/$/g' | paste -sd, -)
envsubst "$env_vars" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf envsubst "$env_vars" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
envsubst "$env_vars" < /etc/nginx/proxy.conf.template > /etc/nginx/proxy.conf envsubst "$env_vars" < /etc/nginx/proxy.conf.template > /etc/nginx/proxy.conf
envsubst "$env_vars" < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf # Process all template files in conf.d directory
for template in /etc/nginx/conf.d/*.template; do
if [ -f "$template" ]; then
output_file="${template%.template}"
envsubst "$env_vars" < "$template" > "$output_file"
fi
done
# Start Nginx using the default entrypoint # Start Nginx using the default entrypoint
exec nginx -g 'daemon off;' exec nginx -g 'daemon off;'

Loading…
Cancel
Save