Adding server name line when 80 http port not defined

This commit is contained in:
2022-10-28 22:38:52 +00:00
parent 8bf5736043
commit ba1772f4aa

View File

@@ -41,8 +41,13 @@ file="/tmp/$DOMAIN.conf"
if [[ "$HTTP_PORT" != "80" ]]; 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; if [[ "$ALIASES_HTTP" != "" ]]; then
echo "server_name $DOMAIN_NAME $ALIASES_HTTP;"
else
echo "server_name $DOMAIN_NAME;"
fi
echo "set_real_ip_from 0.0.0.0/0;
real_ip_header proxy_protocol; real_ip_header proxy_protocol;
rewrite_log on; rewrite_log on;
return 301 https://$DOMAIN_NAME; return 301 https://$DOMAIN_NAME;