1

When there is no disk space, nginx is still able to work correctly.

It can serve static files, and it can pass the request to a fastcgi server (such as PHP), and it can serve the dynamic response to the client.

The problem happens if fastcgi_cache is turned on, and the disk is full. Before serving the response to the client, nginx tries to save it into a file, and that fails (because there is no disk space). Is there a way to configure nginx so it doesn't fail when the disk is full, and fastcgi_cache is turned on? The ideal solution would be just not inserting the new record into the cache, when there is not enough space for it. Is such option possible, while keeping fastcgi_cache generally turned on?

2
  • Nginx doesn't really allow you to reference available disk space anywhere, so I don't think it's possible to do via normal nginx. There might be a way to do it with the Lua module but then you're moving into a complex solution and may as well just set you proper server monitoring to warn you if the disk space is close to running out. Jan 14, 2016 at 9:09
  • You could max_size flag of proxy_cache_path to limit cache size on disk.
    – Alexey Ten
    Jan 14, 2016 at 11:08

0

You must log in to answer this question.

Browse other questions tagged .