fix(nextcloud): Use configurable HTTP port and correct PHP-FPM socket

- Change nginx to listen on ${NEXTCLOUD_HTTP_PORT:-8080} instead of hardcoded port 80
- Fix PHP-FPM socket path to use detected PHP version (php${PHP_VERSION}-fpm.sock)
- Avoids port conflict with HAProxy on port 80 when using host networking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-02-16 08:10:03 +01:00
parent b78ea3b683
commit 5b6bf8560a

View File

@ -358,9 +358,9 @@ echo "Starting PHP-FPM..."
service php${PHP_VERSION}-fpm start service php${PHP_VERSION}-fpm start
# Configure Nginx # Configure Nginx
cat > /etc/nginx/sites-available/nextcloud << 'NGINX' cat > /etc/nginx/sites-available/nextcloud << NGINX
server { server {
listen 80; listen ${NEXTCLOUD_HTTP_PORT:-8080};
server_name _; server_name _;
root /var/www/nextcloud; root /var/www/nextcloud;
@ -414,7 +414,7 @@ server {
fastcgi_param modHeadersAvailable true; fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true; fastcgi_param front_controller_active true;
fastcgi_pass unix:/run/php/php-fpm.sock; fastcgi_pass unix:/run/php/php${PHP_VERSION}-fpm.sock;
fastcgi_intercept_errors on; fastcgi_intercept_errors on;
fastcgi_request_buffering off; fastcgi_request_buffering off;