From 67945cf5563b28a6c1d3ef566ed30f9fc3360640 Mon Sep 17 00:00:00 2001 From: gyurix Date: Thu, 16 Sep 2021 19:04:04 +0000 Subject: [PATCH] Minor bugfixes at nginx config create script. --- scripts/nginx_config_create.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/nginx_config_create.sh b/scripts/nginx_config_create.sh index 8d053da..7f20d59 100755 --- a/scripts/nginx_config_create.sh +++ b/scripts/nginx_config_create.sh @@ -41,7 +41,6 @@ listen $HTTP_PORT; server_name $DOMAIN_NAME; rewrite_log on;" -echo if [[ $REDIRECT_HTTP != "" && $HTTP_PORT != "" ]]; then echo "return 301 $REDIRECT_HTTP;" @@ -64,17 +63,19 @@ echo proxy_set_header Upgrade "'$http_upgrade'"; proxy_set_header Connection "'$http_connection'"; proxy_cookie_path / /; - access_log off; - }" + access_log off;" + if [[ $ERROR_PAGE != "" && $HTTP_PORT != "" ]]; then echo "error_page 404 /$ERROR_PAGE; -location = /$ERROR_PAGE { - root html; - allow all; - index 404.html; - rewrite ^ "'$scheme'" http://$ERROR_PAGE"'$request_uri'" permanent; - }" + location = /$ERROR_PAGE { + root html; + allow all; + index 404.html; + rewrite ^ "'$scheme'" http://$ERROR_PAGE"'$request_uri'" permanent; + }" fi + echo "}" + fi echo "}" fi