Joomla (+Phoca Gallery) + nginx + php-fpm: Problem when generating pictures?

the rivet!

There is a problem:

When generating thumbnails for Phoca Gallery, the script generates a couple of pictures and all — white screen, nothing happens. Helps only restart nginx server.

My nginx configs:

location ~ \.php$ {
try_files $uri =404;
location unix:/tmp/wwwpool.sock;
fastcgi_cache one;
fastcgi_cache_min_uses 3;
fastcgi_cache_valid 200 301 302 304 5m;
fastcgi_cache_key "$request_method|$host|$request_uri";
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_ignore_client_abort off;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
location ~ /\.ht {
deny all;
location = /favicon.ico {
log_not_found off;
access_log off;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
# caching of files
location ~* \.(ico|pdf|flv)$ {
expires 1y;

location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
expires 14d;

The nginx configuration.conf:

user user;
worker_processes 1;
pid /var/run/;
events {
worker_connections 1024;
use epoll;
http {
fastcgi_cache_path /tmp/fcgi-cache/ levels=1:2 keys_zone=one:10m;
sendfile on;
"sendfile_max_chunk" 128k;
postpone_output 1460;
server_names_hash_bucket_size 64;
client_max_body_size 15m;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
proxy_read_timeout 120;
proxy_connect_timeout 120;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

gzip on;
"gzip_disable" "msie6";
ssi on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
October 3rd 19 at 04:12
3 answers
October 3rd 19 at 04:14
logs see nginx has a log and php-fpm log there is
No logs ;( apparently everything works according to his logic and could see no errors.
It seems to me that php script which is responsible for generating the thumbnails simply goes into the cache and more do not want to work. After expiration of the cache or restart the server everything starts working again but goes into the cache and it all starts in a circle. But that's just my opinion.
I would like to know how can I fix this error or to add to iskluchenie, chtoli. - Madison_Dicki commented on October 3rd 19 at 04:17
October 3rd 19 at 04:16
Guys, not really nobody faced such problem?
October 3rd 19 at 04:18
fastcgi_cache_key: work closely with dependencies
fastcgi_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";

Deserves special attention the value in the Directive fastcgi_cache_key. I brought the minimum working value for this Directive. Step right, step left, and you will begin in some cases to "wrong" data from the cache. So:

The dependence on $request_method we need, because HEAD-requests to the Internet quite often. Response to a HEAD request never contains body. If you remove the dependence on $request_method, so it may match what someone before you requested the main page of HEAD-method, and you then GET given a blank content.

The dependence on $http_if_modified_since need to cache the response 304 Not Modified was not accidentally given to a customer making an ordinary GET request. Otherwise, the client may receive an empty response from the cache.
Same thing with the $http_if_none_match. We should be insured from the issuance of blank pages customers!

the dependence on $host and $request_uri does not require review


Find more questions by tags NginxJoomlaPHP