1 year ago

#386148

test-img

The Law

Nginx returns multiple 302 in fractions of a second headers before sending actual content with 200 response

I am stumped by this. We have setup nginx + reverse proxy with PHP as fpm, and every response to request looks something like this

>>> https://some.url/some-req/c-378

> --------------------------------------------
> 302 Found
> --------------------------------------------
Status: 302 Found
Code:   302
Date:   Thu, 07 Apr 2022 08:46:36 GMT
Server: Apache/2.4.41 (Ubuntu)
X-Powered-By:   Nette Framework
Set-Cookie: hash=1mhqkefucc98ka4qhq7dr278q7; expires=Sat, 07-May-2022 08:46:36 GMT; Max-Age=2592000; path=/
Expires:    Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control:  no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location:    https://some.url/some-req/c-378
Access-Control-Allow-Origin:    https://some.url
Connection: close
Content-Type:   text/html; charset=UTF-8

The date header is changing by a ms, like Date: Thu, 07 Apr 2022 8:46:36 GMT... Date: Thu, 07 Apr 2022 08:46:37 GMT and so on, and this happens roughly 19 times before sending the actual content.

So the issue is not that nginx does not return the content or it is not actually reachable, but that in few fractions of miliseconds it returns multiple "resource not available" responses before serving the actual response.

What could be causing this issue? Some misconfiguration or load balancing?

nginx

nginx-reverse-proxy

fpm

0 Answers

Your Answer

Accepted video resources