Resolving 502 errors when logging into Discuz!

Table of Contents

This problem has been around for a long time, and I finally had time to research and solve it today.

question

When logging in, clicking the login button has no effect and does not redirect. The console displays a 502 error message indicating that member.php is redirecting to it.

solve

This problem occurs randomly. I initially thought it was a communication issue after switching to HTTPS, and I also considered whether it was a problem with UCenter or CDN. But in the end, I found that it wasn't.

First, let's look at the nginx error log. It looks like this:

upstream sent too big header while reading response header from upstream, client: 172.69.160.137, server: hellogwu.com, request: 'POST /member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LQccG&inajax=1 HTTP/1.1', upstream: 'fastcgi://unix:/opt/bitnami/php/var/run/www.sock:', host: 'hellogwu.com', referrer: 'https://hellogwu.com/member.php?mod=logging&action=login'

This is clearly a configuration issue with nginx and php-fpm. The solution is to increase the FastCGI buffer.

fastcgi_buffers 16 16k; fastcgi_buffer_size 32k;

This solved the problem, but the issue is very strange. We suspect malicious code was injected during login and will investigate further.

This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:

Original author:Jake Tao,source:"Solve the 502 error when logging into Discuz!"

309
0 0 309

Further Reading

Post a reply

Log inYou can only comment after that.
Share this page
Back to top