diff --git a/mailpiler.sh b/mailpiler.sh index ca58533..9b65461 100644 --- a/mailpiler.sh +++ b/mailpiler.sh @@ -94,7 +94,7 @@ cd /etc/nginx/sites-available cp /tmp/piler-$PILER_VERSION/contrib/webserver/piler-nginx.conf /etc/nginx/sites-available/ ln -s /etc/nginx/sites-available/piler-nginx.conf /etc/nginx/sites-enabled/piler-nginx.conf -sed -i "s|PILER_HOST|$PILER_FQDN|g" /etc/nginx/sites-available/piler-nginx.conf +sed -i "s|PILER_HOST|$PILER_FQDN default_host|g" /etc/nginx/sites-available/piler-nginx.conf sed -i "s|/var/run/php/php7.4-fpm.sock|/var/run/php/php$PILER_PHP_VERSION-fpm.sock|g" /etc/nginx/sites-available/piler-nginx.conf sed -i "/server_name.*/a \\ @@ -114,10 +114,10 @@ sed -i "/server_name.*/a \\ sed -i "/^server {.*/i\ server {\n\ listen 80;\n\ - server_name $PILER_FQDN;\n\ + server_name $PILER_FQDN default_host;\n\ server_tokens off;\n\ # HTTP to HTTPS redirect.\n\ - return 301 https://$PILER_FQDN;\n\ + return 301 https://\$host\$request_uri;\n\ }" /etc/nginx/sites-available/piler-nginx.conf cp /usr/local/etc/piler/config-site.php /usr/local/etc/piler/config-site.php.bak @@ -137,7 +137,7 @@ cat >> /usr/local/etc/piler/config-site.php <> /usr/local/etc/piler/config-site.php <