Today I will post article “The fix error 502 Bad Gateway for Nginx”.This error can be called “WordPress Xmlrpc vulnerability”. This could be that your server is compromised. you are getting a lot of requests to your xmlrpc.php file. and its keeping your server out of resources.
You check the log and if it appears the following error:
2015/07/22 16:56:16 21550#0: *24455 upstream sent unexpected FastCGI record: 3 while reading response header from upstream, client: xxxx.xxx.xx.xx, server: xxx, request: “POST /xmlrpc.php HTTP/1.0″, upstream: “xxx.xxx.xx.xx., host: “xxx.xxx.xxx.xxx”
What to do?
1. After doing a simple Google search I solved the problem by adding two lines to Nginx configuration file/etc/nginx/nginx.conf :
If you use centminmod url see here: /usr/local/nginx/nginx.conf
http { ... fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; ... }
2. Disable plugin Example: iThemes Security,use rename the folder better-wp-security
3. Default nginx config file will be located at /etc/nginx/sites-available/default, you can add the below lines in server context.
location ^~ /xmlrpc.php {
deny all;
}
Centminmod: Go to /usr/local/nginx/conf/conf.d/domain.com.conf
Add row: location ^~ /xmlrpc.php { deny all;}
at
server { ... }
Now restart nginx using below command.
service nginx restart
Good luck!
Leave a Reply
You must be logged in to post a comment.