fix: bypass /tmp tmpfs for file uploads by redirecting PHP upload_tmp_dir to storage partition

This commit is contained in:
Pontoporeia
2026-07-10 15:42:07 +02:00
parent 1293b1be6c
commit c1a05efcda
5 changed files with 35 additions and 4 deletions
+4 -4
View File
@@ -156,7 +156,7 @@ server {
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
# Security parameters (must be <= client_max_body_size)
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M";
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M \n upload_tmp_dir=/var/www/xamxam/storage/tmp/php-uploads";
# Timeouts
fastcgi_read_timeout 600;
@@ -176,7 +176,7 @@ server {
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M";
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M \n upload_tmp_dir=/var/www/xamxam/storage/tmp/php-uploads";
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
}
@@ -199,7 +199,7 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M";
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M \n upload_tmp_dir=/var/www/xamxam/storage/tmp/php-uploads";
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
}
@@ -220,7 +220,7 @@ server {
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
# Security parameters (must be <= client_max_body_size)
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M";
fastcgi_param PHP_VALUE "upload_max_filesize=8192M \n post_max_size=8192M \n upload_tmp_dir=/var/www/xamxam/storage/tmp/php-uploads";
# Timeouts
fastcgi_read_timeout 600;