Skip to content

Commit ca40b52

Browse files
authored
Update production.txt
1 parent 68c7cc6 commit ca40b52

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

modules/nginx/sites/production.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
## X. RSS Feeds
3838
## X. PHP-FPM Routing
3939
## X. WP-Login (Rate Limiting)
40+
## X. Admin-Ajax (Rate Limiting)
4041

4142
## M. Adminer Settings
4243
## N. Redirect Staging/Dev Subdirectories
@@ -494,6 +495,28 @@ location = /wp-login.php {
494495
fastcgi_no_cache $skip_cache;
495496
}
496497

498+
####################################################################################################
499+
#### X. Server Block (Production): Rate Limit admin-ajax.php #######################################
500+
####################################################################################################
501+
502+
location = /wp-admin/admin-ajax.php {
503+
504+
## protect against admin-ajax abuse ##
505+
limit_req zone=admin_ajax_second burst=10 nodelay;
506+
limit_req zone=admin_ajax_minute burst=30 nodelay;
507+
508+
## fastcgi configurations ##
509+
include /etc/nginx/fastcgi.conf;
510+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
511+
fastcgi_pass 127.0.0.1:9000;
512+
fastcgi_read_timeout 300;
513+
fastcgi_index index.php;
514+
515+
## bypass caching ##
516+
fastcgi_cache_bypass $skip_cache;
517+
fastcgi_no_cache $skip_cache;
518+
}
519+
497520
####################################################################################################
498521
#### I. Server Block (Production): Adminer Script ##################################################
499522
####################################################################################################

0 commit comments

Comments
 (0)