Recently, the program encounter ed a problem, LNMP environment, because PHP in the program spliced GET request uri parameter is too long, resulting in an error, nginx processing uri is too long can be processed by client_head_buffer_size parameter, but when nginx received the uri request forward to PHP, fastcgi can not handle the request error (do not consider changing the request to post).
System:linux CentOS7 nginx:1.14.0 php:7.2.0
Apache solution:
Add a few parameters to the configuration file
LimitRequestLine 40940
LimitRequestFieldSize 40940
Nginx solution:
**How to increase the limit of fastcgi to accept uri parameter size?**
user test;
worker_processes 2;
worker_cpu_affinity 0101 1010;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include mime.types;
default_type application/octet-stream;
charset utf-8;
sendfile on;
tcp_nopush on;
keepalive_timeout 300s;
client_header_timeout 300s;
client_body_timeout 300s;
client_max_body_size 100m;
client_body_buffer_size 2048k;
client_header_buffer_size 1024k;
large_client_header_buffers 32 64k;
send_timeout 300s;
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 1024k;
fastcgi_buffers 64 64k;
fastcgi_busy_buffers_size 2048k;
fastcgi_temp_file_write_size 2048k;
gzip on;
gzip_min_length 1k;
gzip_buffers 16 16k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/javascript application/xml;
gzip_comp_level 3;
gzip_vary on;
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
include /*.conf;
}
Fastcgi error log [1]: https://i.stack.imgur.com/lzV4H.png
Please Help!!! SOS