Level 1
Problem solved
I forgot to check the error.log which says that upstream sent too big header while reading response header from upstream.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Good day guys. I've just uploaded my project to production Ubuntu 22.04 LEMP server and faced the 502 Bad Gateway error. The case is when I open the page for the fist time it works, but as soon as I try to refresh the page I get this error.
My Nginx config:
server {
server_name mysite.com www.mysite.com;
root /var/www/mysite/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Problem solved
I forgot to check the error.log which says that upstream sent too big header while reading response header from upstream.
Please or to participate in this conversation.