Welcome! Log In Create A New Profile

Advanced

How to make nginx fail if it can't write to cache dir.

January 27, 2022 06:07AM
Hi,

Nginx version: nginx/1.20.2

Cache config:
proxy_cache_path /nginx/cache levels=1:2 keys_zone=bla:20m max_size=10g inactive=20m use_temp_path=off;

I had a problem while using tmpfs mount for nginx cache dir, my automation mounted it over and over again(so each time nginx created a new set of base dirs [a-z]), but after a few mounts, it could no longer create new base dirs(no more memory) and writes to the cache dir failed with:
[crit] 31334#31334: *128216 mkdir() "/nginx/cache/4" failed (13: Permission denied) while reading upstream

But nginx still accepted connections and the client got a hangup during transfer each time.
How can I fail nginx when this thing happens, so clients will not get to it ?

Thanks.
Subject Author Posted

How to make nginx fail if it can't write to cache dir.

unikron January 27, 2022 06:07AM

RE: How to make nginx fail if it can't write to cache dir.

Reinis Rozitis January 27, 2022 06:44AM

Re: RE: How to make nginx fail if it can't write to cache dir.

unikron January 27, 2022 07:57AM

RE: RE: How to make nginx fail if it can't write to cache dir.

Reinis Rozitis January 27, 2022 09:14AM

Re: RE: RE: How to make nginx fail if it can't write to cache dir.

unikron January 30, 2022 04:01AM

Re: RE: RE: How to make nginx fail if it can't write to cache dir.

Francis Daly February 01, 2022 03:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready