Nginx Security Hardening and Rules

c0nw0nk nginx-forum at
Thu Oct 23 15:43:44 UTC 2014

I use a subdomain for uploads and i am curious if anyone knows the best way
to only allow access to only the upload url and block / deny everything

location / {
deny all;
location ~ \.php$ {
deny all;
if ( $args ~
'option=com_hwdmediashare&task=addmedia.upload([a-zA-Z0-9-_=&])' ) {
fastcgi_pass web_rack;

Is this the best way ?

Posted at Nginx Forum:,254125,254224#msg-254224

More information about the nginx mailing list