-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Description
Description
Assuming php-fpm and nginx configured to allow large URLs ( http{ large_client_header_buffers 8 999k; ...}
)
The following code:
<?php
$url = "http://localhost/?a=" . str_repeat("a", 33*1024);
$ch = curl_init($url);
curl_exec($ch);
Resulted in
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>
and /var/log/nginx/error.log
containing
2023/12/20 06:15:30 [error] 7980#7980: *32033 writev() failed (32: Broken pipe) while sending request to upstream, client: 162.248.164.115, server: localhost, request: "GET /?a=aaaaaaaaaa(...)
and nothing in /var/log/php8.2-fpm.log
But I expected... a notice in the php-fpm log that something went wrong? and maybe a HTTP 414 Request-URL too long
error instead of a 502 Bad Gateway
?
PHP Version
PHP 8.2.7
Operating System
Debian 12