I just recently switched from Apache to Nginx and everything seemed to be going well. However, while testing a PunBB site that I brought over, I got a 502 Bad Gateway error when trying to make a post. The strange thing was, the behavior was inconsistent. I could post in some threads, but not others. A bit of googling turned up this page and the suggestion there worked for me.
Looks like the default header limits on Nginx were too small for my site, so I added these two lines to my nginx.conf:[note color=”#DDD”]/etc/nginx/nginx.conf
# Basic Settings
# Setting up a zone to limit repeated search requests
# Learned the hard way that I had to put this before any includes
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
# Logging Settings
I could have just added them to that site’s config, but it’s not the only forum site I run, so I figured I’d just make it a global setting.