Attempt to open Symfony web application in browser ends with 502 error. NGINX log contains error for this -- upstream sent too big header while reading response header from upstream. According to many advices did the following changes in nginx.conf in http context:
fastcgi_buffers 16 4k;
fastcgi_busy_buffers_size 60k;
NGINX configuration file for Symfony web application looks like adviced in official documentation:
server {
listen 80;
listen [::]:80;
server_name neuro3.vbulash.site;
root /usr/share/nginx/html/neuro3/public;
index index.html index.php;
charset utf-8;
location = /favicon.ico {
access_log off; log_not_found off;
}
location = /robots.txt {
access_log off; log_not_found off;
}
access_log off;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
error_log /var/log/nginx/neuro3.vbulash.site.error.log;
}
It works for Laravel, but produces the error "upstream sent too big header while reading response header from upstream" for Symfony. How to fix this?