bibitws Hello, I made an "anti hotlinking image" file, and put it in the /var/www/example.com/conf/nginx folder, but it doesn't work. Images still appear when loaded in another domain. Does WordOps not support "anti hotlinking"? Sorry for my bad English.
bibitws portofacil location ~* \.(jpg|jpeg|gif|png)$ { valid_referers none blocked example.com www.example.com ~.google. ~.bing. ~.yahoo. ~.yandex. ~.ask. ~.duckduckgo.; if ($invalid_referer) { return 403; } }
rsmith4321 I'm having the same issue, I've tried putting similar code in the /var/www/example.com/conf/nginx folder as well as directly in locations-wo.conf. Nginx restarts fine but hotlinking isn't prevented, I can't quite figure it out.
marty It's not a WordOps feature (as far as I know?) - although there is an enhancement request for it:- WordOps/WordOps#232 So presumably you're using custom code similar to what was posted above? If so, how are you testing it?
blacksnow1 marty I see. Well, I have tried both methods. Modifying hontlink.conf and also modifying site config directly via command line but without success. Other domains can still load the content. I tried this code: location ~ .(gif|png|jpg|jpe?g|css|ico|mp4|m4v|vtt|srt|xml)$ { valid_referers none blocked website.com *.website.com ; if ($invalid_referer) { return 403; } }
marty Ah, OK. It's the rule in /etc/nginx/common/locations-wo.conf overriding it (the one to cache static files,location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|...) Not sure of the best workaround but that's why it isn't working.