-
-
Save jyntran/32e97587b0c718ff03e0aed184a1dfe3 to your computer and use it in GitHub Desktop.
Nginx disable hotlinking and error pages
This file contains hidden or 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
server { | |
server_name site.jyntran.ca | |
root /var/www/html | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
location /assets/ { | |
# custom error page | |
error_page 403 /403.html; | |
# disable direct linking | |
valid_referers server_names *.jyntran.ca; | |
if ($invalid_referer) { | |
return 403; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment