Password protect WordPress admin but allow admin-ajax.php?

#1
I'm able to password protect the admin area but there are plugins that still need access to admin-ajax.php.

Does anyone know how to make this work? I tried adding /wp-admin/admin-ajax.php as an allowed context, placed before blocking /wp-admin/ with basic auth. This did not work. (but I could be doing it wrong)

Any help will be greatly appreciated. Thanks!
 

Cold-Egg

Administrator
#2
I tested it and it works, here's my config,

Code:
context /wp-admin/ {
  location                /var/www/html/wp-admin/
  allowBrowse             0

  rewrite  {

  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}

context /wp-admin/admin-ajax.php {
  location                /var/www/html/wp-admin/
  allowBrowse             1

  rewrite  {

  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}
 
Top