Fixing http section when variable empty
This commit is contained in:
@@ -37,7 +37,7 @@ file="/tmp/$DOMAIN.conf"
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if [[ "$HTTP_PORT" != "80" || "$HTTP_PORT" == "" ]]; then
|
if [[ "$HTTP_PORT" != "80" ]]; then
|
||||||
echo "server {
|
echo "server {
|
||||||
listen 80 proxy_protocol;
|
listen 80 proxy_protocol;
|
||||||
set_real_ip_from 0.0.0.0/0;
|
set_real_ip_from 0.0.0.0/0;
|
||||||
@@ -48,10 +48,11 @@ return 301 https://$DOMAIN_NAME;
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "server {
|
if [[ "$HTTP_PORT" != "" || "$HTTP_PORT" != "80" ]]; then
|
||||||
listen $HTTP_PORT proxy_protocol;
|
echo "server {
|
||||||
set_real_ip_from 0.0.0.0/0;
|
listen $HTTP_PORT proxy_protocol;
|
||||||
real_ip_header proxy_protocol;"
|
set_real_ip_from 0.0.0.0/0;
|
||||||
|
real_ip_header proxy_protocol;"
|
||||||
|
|
||||||
if [[ "$ALIASES_HTTP" != "" ]]; then
|
if [[ "$ALIASES_HTTP" != "" ]]; then
|
||||||
echo "server_name $DOMAIN_NAME $ALIASES_HTTP;"
|
echo "server_name $DOMAIN_NAME $ALIASES_HTTP;"
|
||||||
@@ -67,7 +68,7 @@ real_ip_header proxy_protocol;"
|
|||||||
echo "client_max_body_size 0;"
|
echo "client_max_body_size 0;"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "rewrite_log on;"
|
echo "rewrite_log on;"
|
||||||
|
|
||||||
|
|
||||||
if [[ "$REDIRECT_HTTP" != "" ]] ; then
|
if [[ "$REDIRECT_HTTP" != "" ]] ; then
|
||||||
@@ -118,7 +119,8 @@ echo "rewrite_log on;"
|
|||||||
}"
|
}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "}"
|
echo "}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$HTTPS_PORT" != "" ]]; then
|
if [[ "$HTTPS_PORT" != "" ]]; then
|
||||||
echo "server {
|
echo "server {
|
||||||
|
Reference in New Issue
Block a user