You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extra/troubleshooting.md
+55Lines changed: 55 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,3 +40,58 @@ jms_serializer:
40
40
```
41
41
42
42
The JMS Serializer service is available as `jms_serializer`.
43
+
44
+
## "upstream sent too big header while reading response header from upstream" 502 Error
45
+
46
+
Some of your API calls fail with a 502 error and the logs for the api container shows the following error message `upstream sent too big header while reading response header from upstream`.
47
+
48
+
This can be due to the cache invalidation headers that are too big for NGINX. When you query the API, API Platform adds the ids of all returned entities and their dependencies in the headers like so : `Cache-Tags: /entity/1,/dependent_entity/1,/entity/2`. This can overflow the default header size (4k) when your API gets larger and more complex.
49
+
50
+
You can modify the `api/docker/nginx/conf.d/default.conf` file and set values to `fastcgi_buffer_size` and `fastcgi_buffers` that suit your needs, like so:
51
+
52
+
```
53
+
server {
54
+
root /srv/api/public;
55
+
56
+
location / {
57
+
# try to serve file directly, fallback to index.php
58
+
try_files $uri /index.php$is_args$args;
59
+
}
60
+
61
+
location ~ ^/index\.php(/|$) {
62
+
# Comment the next line and uncomment the next to enable dynamic resolution (incompatible with Kubernetes)
63
+
fastcgi_pass php:9000;
64
+
#resolver 127.0.0.11;
65
+
#set $upstream_host php;
66
+
#fastcgi_pass $upstream_host:9000;
67
+
68
+
# Bigger buffer size to handle cache invalidation headers expansion
69
+
fastcgi_buffer_size 128k;
70
+
fastcgi_buffers 4 256k;
71
+
72
+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
73
+
include fastcgi_params;
74
+
# When you are using symlinks to link the document root to the
75
+
# current version of your application, you should pass the real
76
+
# application path instead of the path to the symlink to PHP
77
+
# FPM.
78
+
# Otherwise, PHP's OPcache may not properly detect changes to
79
+
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
0 commit comments