This is probably related to #2097673: Nginx SSL Redirect Loop
Nginx should not cache 302 responses, or at least it should use the lowest possible value for DoS protection (1s).
There is also no point in trying to cache 5xx errors, while 403 and 404 should also be cached like 302 -- only to protect from DoS attempts.
It could use higher value for 301, perhaps.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 0001-Nginx-Improve-fastcgi_cache_valid-TTL-settings.patch | 3.16 KB | memtkmcc |
Comments
Comment #2
memtkmcc commentedAttached patch fixes this, but note that it depends on earlier patch from #2738983: Nginx unknown status variable
Comment #3
memtkmcc commentedComment #4
millenniumtreeAwesome, yeah, I hadn't considered DoS protection in the cache lifetime. That makes good sense.
Comment #5
memtkmcc commented@millenniumtree -- by the way, it was a good suggestion to add
$schemeto the mix. We have had$http_x_forwarded_proto $sent_http_x_local_protothere before, and it worked fine with local HTTPS proxy to avoid sharing cache keys between plain HTTP and HTTPS, but once we moved to support Aegir built-in HTTPS and LE in BOA,$http_x_forwarded_proto $sent_http_x_local_protocouldn't work (both empty), while$schemestarted to make sense -- especially if you don't force HTTPS-only.Comment #7
memtkmcc commentedFix committed.