From 9b3f9d8a689a22c85dfce88039e601b153f07150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 17:25:02 +0100 Subject: [PATCH] Fix --- conf/extra_php-fpm.conf | 4 ++-- conf/nginx.conf | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index 017da9e..700c37c 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -1,4 +1,4 @@ ; Additional php.ini defines, specific to this pool of workers. -php_admin_value[upload_max_filesize] = 256M -php_admin_value[post_max_size] = 256M +php_admin_value[upload_max_filesize] = 50M +php_admin_value[post_max_size] = 50M diff --git a/conf/nginx.conf b/conf/nginx.conf index e8d8e6d..f68f24f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,11 +7,11 @@ location __PATH__/ { index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - client_max_body_size 256M; + client_max_body_size 50M; - try_files $uri $uri/ __PATH__/index.php; + try_files $uri __PATH__/index.php; - location ~ [^/]\.php(/|$) { + location ~ ^/index\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; @@ -19,7 +19,14 @@ location __PATH__/ { include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + } + + location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { + access_log off; + expires 1h; + add_header Cache-Control public; } # Include SSOWAT user panel.