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 -4
View File
@@ -73,6 +73,7 @@ $STD npm run build
msg_ok "Installed Salt Rim"
msg_info "Creating Service"
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/barassistant.conf
server {
listen 80 default_server;
@@ -126,7 +127,7 @@ server {
error_page 404 /index.php;
location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/var/run/php/php$PHPVER-fpm.sock;
fastcgi_pass unix:${PHP_SOCK};
fastcgi_param SCRIPT_FILENAME \$realpath_root\$fastcgi_script_name;
include fastcgi_params;
fastcgi_hide_header X-Powered-By;
@@ -148,9 +149,7 @@ server {
}
EOF
ln -s /etc/nginx/sites-available/barassistant.conf /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/default
$STD systemctl reload nginx
nginx_enable_site barassistant.conf
msg_ok "Created Service"
motd_ssh