Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

403 based on $request_body

$
0
0
I'm using nginx v1.2.6 along with php5-fpm on Debian. I would like to block POST requests containing a certain word so I have used the following config

server {
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
if ($request_body ~* word) {
return 403;
}
}
}

But i doesn't work at all.

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>