samedi 9 mai 2015

Deny use nginx for defined directory or regex

We have on server both apache and nginx. For static files we use nginx.

On site we have a lot of images, which have parameter in query string e.g

<img src="/images/main/example.jpg?src=http://ift.tt/1u6vnWS" />

for this we use in .htaccess file directive

RewriteCond %{REQUEST_URI} images\/main\/.*
RewriteCond %{QUERY_STRING} from=(.*)$
RewriteRule (.*) %1

But when I see log file from nginx I see a lot of error that file /images/main are missing - in one day 300 Mb of logs.

Could we use nginx directive for deny use files by regex ?

Aucun commentaire:

Enregistrer un commentaire