From 70e077b58caf5cb5a864437180c639367d186a5f Mon Sep 17 00:00:00 2001 From: gyurix Date: Thu, 1 Jul 2021 08:23:23 +0000 Subject: [PATCH] Minor bugfixes. --- scripts/nginx_config_create.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/nginx_config_create.sh b/scripts/nginx_config_create.sh index 4e5bcce..0fa9434 100755 --- a/scripts/nginx_config_create.sh +++ b/scripts/nginx_config_create.sh @@ -112,9 +112,14 @@ location = /$ERROR_PAGE { }" fi -echo "location / { - proxy_pass http://$LOCAL_IP:$HTTP_PORT; - proxy_redirect off; +echo "location / {" + if [ $HTTP_PORT == "" ]; then + echo "proxy_pass http://$LOCAL_IP:80;" + else + echo "proxy_pass http://$LOCAL_IP:$HTTP_PORT;" + fi + +echo "proxy_redirect off; proxy_buffering off; proxy_set_header X-Forwarded-For "'$proxy_add_x_forwarded_for'"; proxy_set_header Upgrade "'$http_upgrade'";