Fixing listen ports in nginx config generation script to 80 and 443

This commit is contained in:
2022-08-26 16:28:22 +00:00
parent fdbe2be769
commit c6343a976a

View File

@@ -45,7 +45,7 @@ if [[ "$HTTP_PORT" != "" ]]; then
fi fi
echo "server { echo "server {
listen $DEFAULT_HTTP_PORT proxy_protocol; listen 80 proxy_protocol;
set_real_ip_from 0.0.0.0/0; set_real_ip_from 0.0.0.0/0;
real_ip_header proxy_protocol;" real_ip_header proxy_protocol;"
@@ -66,7 +66,7 @@ real_ip_header proxy_protocol;"
echo "rewrite_log on;" echo "rewrite_log on;"
if [[ "$REDIRECT_HTTP" != "" && "$HTTP_PORT" != "" ]] ; then if [[ "$REDIRECT_HTTP" != "" ]] ; then
echo "return 301 $REDIRECT_HTTP;" echo "return 301 $REDIRECT_HTTP;"
elif [[ "$HTTP_PORT" == "" ]]; then elif [[ "$HTTP_PORT" == "" ]]; then
echo "return 301 https://"$DOMAIN_NAME; echo "return 301 https://"$DOMAIN_NAME;
@@ -86,7 +86,7 @@ echo "rewrite_log on;"
fi fi
if [[ "$HTTP_PORT" != "" ]]; then if [[ "$HTTP_PORT" != "" ]]; then
echo " proxy_pass http://$LOCAL_IP:$DEFAULT_HTTP_PORT;" echo " proxy_pass http://$LOCAL_IP:$HTTP_PORT;"
fi fi
echo " proxy_set_header Host "'$http_host'"; echo " proxy_set_header Host "'$http_host'";
@@ -119,7 +119,7 @@ fi
if [[ "$HTTPS_PORT" != "" ]]; then if [[ "$HTTPS_PORT" != "" ]]; then
echo "server { echo "server {
listen $HTTPS_PORT ssl proxy_protocol; listen 443 ssl proxy_protocol;
set_real_ip_from 0.0.0.0/0; set_real_ip_from 0.0.0.0/0;
real_ip_header proxy_protocol;" real_ip_header proxy_protocol;"
@@ -173,8 +173,8 @@ location = /$ERROR_PAGE {
done done
echo " deny all;" echo " deny all;"
fi fi
if [[ "$HTTP_PORT" != "" ]]; then if [[ "$HTTPS_PORT" != "" ]]; then
echo " proxy_pass http://$LOCAL_IP:$HTTP_PORT;" echo " proxy_pass http://$LOCAL_IP:$HTTPS_PORT;"
else else
echo " proxy_pass http://$LOCAL_IP:80;" echo " proxy_pass http://$LOCAL_IP:80;"
fi fi