Fixing http section when variable empty

This commit is contained in:
2022-09-30 09:52:46 +00:00
parent 3de68bf07b
commit 1902534bf0

View File

@@ -37,7 +37,7 @@ file="/tmp/$DOMAIN.conf"
{
if [[ "$HTTP_PORT" != "80" || "$HTTP_PORT" == "" ]]; then
if [[ "$HTTP_PORT" != "80" ]]; then
echo "server {
listen 80 proxy_protocol;
set_real_ip_from 0.0.0.0/0;
@@ -48,6 +48,7 @@ return 301 https://$DOMAIN_NAME;
fi
if [[ "$HTTP_PORT" != "" || "$HTTP_PORT" != "80" ]]; then
echo "server {
listen $HTTP_PORT proxy_protocol;
set_real_ip_from 0.0.0.0/0;
@@ -119,6 +120,7 @@ echo "rewrite_log on;"
fi
fi
echo "}"
fi
if [[ "$HTTPS_PORT" != "" ]]; then
echo "server {