From ba1772f4aab299d78cac9dd2a2d791cdb6a69143 Mon Sep 17 00:00:00 2001 From: gyurix Date: Fri, 28 Oct 2022 22:38:52 +0000 Subject: [PATCH] Adding server name line when 80 http port not defined --- scripts/nginx_config_create.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/nginx_config_create.sh b/scripts/nginx_config_create.sh index 9430e3b..96ee59a 100755 --- a/scripts/nginx_config_create.sh +++ b/scripts/nginx_config_create.sh @@ -41,8 +41,13 @@ file="/tmp/$DOMAIN.conf" if [[ "$HTTP_PORT" != "80" ]]; then echo "server { -listen 80 proxy_protocol; -set_real_ip_from 0.0.0.0/0; +listen 80 proxy_protocol;" + if [[ "$ALIASES_HTTP" != "" ]]; then + echo "server_name $DOMAIN_NAME $ALIASES_HTTP;" + else + echo "server_name $DOMAIN_NAME;" + fi +echo "set_real_ip_from 0.0.0.0/0; real_ip_header proxy_protocol; rewrite_log on; return 301 https://$DOMAIN_NAME;