D
D
d1gi2017-04-30 19:48:50
Nginx
d1gi, 2017-04-30 19:48:50

Unstable rendering of Nginx images. Where to dig?

There is the following image resizing system.
If the image has not yet been generated, then the following link is generated:
/media/myfilter/filename.jpeg?id=6
Here, the original image is retrieved from the database with id = 6, processed by the myfilter filter and simultaneously sent to the user with the mimetype image/ jpeg, and is also saved along the route /media/myfilter/filename.jpeg
Further, when requesting a picture with ID = 6, the database knows that a file with this filter already exists and a link will be generated:
/media/myfilter/filename.jpeg
Where is the web the server will already give the file directly.
The problem is that such files /media/myfilter/filename.jpeg are given unstable, about 80% work, and the rest simply do not come from the server...
OS Debian 8, nginx 1.11.13
tried on 2 vps with 512mb ram and 6gb ram
nginx config:

location @rewriteapp {
  rewrite ^(.*)$ /app.php/$1 last;
}

location ~ ^/app\.php(/|$) {
  fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  fastcgi_split_path_info ^(.+\.php)(/.*)$;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  fastcgi_param HTTPS off;
  internal;
}

location ~ ^/media {
  access_log off;
  expires 30d;
  try_files $uri @rewriteapp;
}

Has anyone experienced something similar?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question