After double-checking the nginx configuration, I found that the request headers were too large, so I changed the server configuration and the problem was solved, thanks!
server {
...
client_header_buffer_size 8k;
large_client_header_buffers 4 32k;
...
}