Securing wp-admin causes admin-ajax.php errors

#1
Hello all,

I've secured wp-admin folder for my WP instance via OpenLiteSpeed GUI: Virtual Hosts -> Context:

URI: /wp-admin/
Location: $DOC_ROOT/wp-admin/
Accessible: Yes
Access Allowed: My IP HERE
Access Denied: *

All other settings are set to default and it is working as expected only I have access to wp-admin folder.

I've added additional context for admin-ajax.php file so that it could be accessed, like this:


URI: /wp-admin/admin-ajax.php
Location: $DOC_ROOT/wp-admin/admin-ajax.php
Accessible: Yes

All other settings to default.

However this is causing issues with QuickCloud CND for example:


2024-01-08 17:09:36.867850 [INFO] [368362] [45.132.244.92:33490#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!
2024-01-08 17:09:36.868400 [INFO] [368365] [45.132.244.92:33502#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!
2024-01-08 17:09:39.265665 [INFO] [368364] [45.132.244.92:44486#my_website.com] Connection idle time too long: 31 while in state: 6 watching for event: 0, close!
2024-01-08 17:09:39.265682 [INFO] [368364] [45.132.244.92:44486] Content len: 0, request line: 'POST /wp-admin/admin-ajax.php?action=async_litespeed&nonce=a01a0b9ec8&litespeed_type=imgoptm HTTP/1.1'
2024-01-08 17:09:39.265688 [INFO] [368364] [45.132.244.92:44486#my_website.com] HttpExtConnector state: 8, request body sent: 0, response body size: -2, response body sent:0, left in buffer: 0, attempts: 0.
2024-01-08 17:10:32.562819 [INFO] [368365] [185.116.60.231:43600#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!
2024-01-08 17:10:32.568599 [INFO] [368362] [185.116.60.231:43612#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!
2024-01-08 17:11:37.418325 [INFO] [368364] [146.88.239.197:48102#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!
2024-01-08 17:11:37.419378 [INFO] [368360] [146.88.239.197:48090#my_website.com] [ACL] Access to context [/wp-admin/admin-ajax.php] is denied!

How I can still have restricted wp-admin access to my IP only and at the same time to not have such issues with admin-ajax.php ?

Thank you in advance.
 
Top