Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bloccare hotlinking su server Nginx - ADV
# è possibile definire una cartella da bloccare
# location = /immagini/vietato_rubare.png
# oppure i tipi di file
location ~ \.(gif|png|jpg|jpeg|JPG|GIF|JPEG|PNG)$ {
valid_referers none blocked ilmiosito.com *.ilmiosito.com;
if ($invalid_referer) {
rewrite \.(gif|png|jpg|jpeg|JPG|GIF|JPEG|PNG)$ http://www.ilmiosito.com/immagini/vietato_rubare.PENG redirect;
# alternativa
# rewrite ^(.*)$ http://ilmiosito.com/immagini/vietato_rubare.png last;
}
}
@evemilano

This comment has been minimized.

Copy link
Owner Author

evemilano commented Feb 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.