Answer the question
In order to leave comments, you need to log in
Set up a ban on images on the server through nginx?
It is necessary to prohibit on the current site sitq1 to prohibit opening images through the browser, and on the site2 to allow previews from site1 I'm
picking nginx, it doesn't work, I can't set up
location / {
proxy_pass http://000.000.000.000:8080;
location ~* ^.+\.(jpg|jpeg|txt|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf||mpg|wmv|exe|iso|dmg| swf)$ {
root /home/admin/web/site1/public_html;
access_log /var/log/httpd/domains/site1.log combined;
access_log /var/log/httpd/domains/site1.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
if you remove jpg from the first one and add a condition, then it blocks on site2
location ~* ^/m/.+\.(js|jpg)$ {
valid_referers none blocked site2 *.site2;
if ($invalid_referer) {return 403;}
}
Answer the question
In order to leave comments, you need to log in
for site1:
location ~* .*\.(jpg)$ {
valid_referer site2;
if ($invalid_referer) {return 403;}
root ...
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question