Answer the question
In order to leave comments, you need to log in
Is it possible to know the size of the backend response?
Hi!
There is a working nginx as a proxy, is it possible to do something like this:
if ($content_length == '11088')
{ return 404; }
Answer the question
In order to leave comments, you need to log in
There is an upstream module that stores the size of the response in a variable, as well as a bunch of other useful information.
nginx.org/ru/docs/http/ngx_http_upstream_module.html
As far as I know, this can only be added to Lua as an "add-on".)
Something tells me that you have measured the size of the page with an error coming from the backend and are diligently trying to return nginx's 404 in this case.
IMHO a rake and a crutch. Give a normal warning from the backend side and replace it on the nginx side with the one you need. It's very easy to google.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question