Answer the question
In order to leave comments, you need to log in
How to set up NGINX for referrer protection?
I want people to not be able to make hotlinks (integrate my js, css to their sites), only for my domain.
It would also be impossible to go through an empty referrer and open the code for viewing through a browser (js, css), but it was executed.
What to do with search engines, do they need them? How to take them into account?
Thank you!
Answer the question
In order to leave comments, you need to log in
Ask yourself - why? Who needs it, that code will look anyway. And does anyone really need your scripts and pictures?
And for your question - go to Google, there are a bunch of questions on StackOverflow for any relevant query.
location ~ ^/([a-zA-Z0-9\.\-]*)/(.*) {
if ($http_referer !~ "^$1.*$"){
return 403;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question