Created
January 27, 2015 13:24
-
-
Save evemilano/16f0df40bdc8905aaa9e to your computer and use it in GitHub Desktop.
Bloccare hotlinking su server Nginx - ADV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# è 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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.evemilano.com/2014/11/hotlinking/