i have tried tweaking the nginx config to prevent image hotlinking in my current ghost setup, by adding a location block like this :
location ~ .(gif|ico|png|jpe?g)$ {
valid_referers
server_names
example.com
;
if ($invalid_referer) {
return 403;
}
}
and included this conf inside :
/etc/nginx/site-enabled/example.com-ssl.conf
before the location /
block.
and now, invalid referers will get 403
as expected, but all valid referers will get 404
instead of 200
.
anyone has any ideas why ?