Hi, I would like to block direct access to files uploaded to wp-content.
So I tried to add:
location = /wp-content/ {
valid_referers none blocked .domain.com domain. ;
if $invalid_referer {
deny all;
}
}
But then nginx -t gives a “invalid condition "$invalid_referer"”. I think the ngx_http_referer_module is not by included by default.
Any idea to solve this? Thanks,