mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-21 11:55:53 +02:00
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:
@@ -93,6 +93,7 @@ chmod -R 755 /opt/wallabag/{var,web/assets}
|
||||
msg_ok "Installed Wallabag"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
PHP_SOCK=$(get_php_fpm_socket)
|
||||
cat <<'EOF' >/etc/nginx/sites-available/wallabag
|
||||
server {
|
||||
listen 8000;
|
||||
@@ -110,7 +111,7 @@ server {
|
||||
}
|
||||
|
||||
location ~ ^/app\.php(/|$) {
|
||||
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
|
||||
fastcgi_pass unix:__PHP_SOCK__;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
@@ -131,9 +132,8 @@ server {
|
||||
}
|
||||
EOF
|
||||
|
||||
ln -sf /etc/nginx/sites-available/wallabag /etc/nginx/sites-enabled/
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
$STD systemctl reload nginx
|
||||
sed -i "s|__PHP_SOCK__|${PHP_SOCK}|" /etc/nginx/sites-available/wallabag
|
||||
nginx_enable_site wallabag
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
msg_info "Enabling Services"
|
||||
|
||||
Reference in New Issue
Block a user