Exclure location in nginx

  nginx-location, php

hello I have this security line which blocks access to the php file in /wp-content/

    location ~* (/wp-content/.*.php|/wp-includes/.*.php|/xmlrpc.php$|/(?:uploads|files)/.*.php$) {
            deny all;
            access_log off;
            log_not_found off;
            return 444;
   }

I would like to allow access to a php file

/wp-content/plugins/name_plugin/includes/php_file.php

i tried

location /wp-content/plugins/name_plugin/includes/php_file.php {
    allow all;
     return 403;            
    }

but it doesn’t work it just avoids a 404 error from another line of security, the page works by removing the blocking location … Thank you

Source: Ask PHP

LEAVE A COMMENT