-3

We are optimizing the default configuration for SlickStack, and looking for some good values to recommend to users for the limit_req and limit_conn settings in Nginx.

There are plenty of tutorials around the web, but the settings used are very random.

Most of the time, something like rate=1r/s with burst=1 nodelay is used for URIs like /wp-login.php however this seems too liberal for strong security.

There's also not much discussion about rate-limiting the entire server/website, .php files, and so forth.

The limit_conn feature is rarely mentioned, and limit_rate as well.

I'm hoping to start a thread about some possible settings for typical WordPress websites, with a special nod toward cloud servers or non-shared hosting environments, keeping in mind that these settings should be adjusted depending on your expected traffic levels and otherwise...

1 Answers1

0

There is a lot of inaccurate information online about rate-limiting in WordPress. Specifically, many people assume that 1 request = 1 page load, which is wrong. There is also significant misinformation about what the per second /s and per minute /m directives mean and what the results will be...

The average WordPress website might require 50-100+ "requests" for a single page load, because of all the different PHP, JS, CSS, etc assets being loaded.

Here are some possible settings for limit_req and limit_conn for a typical WordPress site:

For /wp-login.php rate-limit:

  • limit_req_zone $binary_remote_addr zone=wplogin:10m rate=1r/s;
  • limit_req zone=wplogin burst=1 nodelay

For server-wide (e.g. location / in server block):

  • limit_req_zone $binary_remote_addr zone=sitewide:10m rate=50r/s;
  • limit_req zone=sitewide burst=100 nodelay;

I will add more later after more testing...