Standardize nginx setup in install scripts

Refactors many install scripts to use the shared `nginx_enable_site` helper instead of manual symlink/default-site/reload sequences, making webserver setup more consistent and less error-prone. It also replaces hardcoded PHP-FPM socket paths with `get_php_fpm_socket` (including templated substitutions where needed) across nginx and caddy configs to improve compatibility with varying PHP versions and socket locations.
This commit is contained in:
MickLesk
2026-07-28 14:57:58 +02:00
parent f862ce0c13
commit b7688ff97a
44 changed files with 77 additions and 156 deletions
+3 -6
View File
@@ -29,6 +29,7 @@ chown -R www-data:www-data /var/www/html
msg_ok "Deployed Poznote"
msg_info "Configuring Nginx"
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/poznote
server {
listen 8040;
@@ -41,7 +42,7 @@ server {
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_pass unix:${PHP_SOCK};
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT \$document_root;
}
@@ -51,11 +52,7 @@ server {
}
}
EOF
ln -sf /etc/nginx/sites-available/poznote /etc/nginx/sites-enabled/poznote
rm -f /etc/nginx/sites-enabled/default
$STD nginx -t
systemctl enable -q --now nginx
systemctl reload nginx
nginx_enable_site poznote
msg_ok "Configured Nginx"
motd_ssh