# Nginx WAF rules for PHP # Automatically generated from OWASP rules. # Include this file in your server or location block. map $request_uri $waf_block_php { default 0; "~*(?i)" 1; "~*(?i)php://(?:std(?:in|out|err)|(?:in|out)put|fd|memory|temp|filter)" 1; "~*.*.ph(?:pd*|tml|ar|ps|t|pt).*$" 1; "~*[oOcC]:d+:\".+?\":d+:{.*}" 1; } if ($waf_block_php) { return 403; # Log the blocked request (optional) # access_log /var/log/nginx/waf_blocked.log; }