• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Issue Hotlink protection and Expire headers doesn't work together

ChrisCP

Basic Pleskian
I tried to add hotlink protection to my domains. This also works as far as the expires headers no longer work or vice versa. Is this a bug or am I doing something wrong? I don't use WordPress sites. Can someone help me there? I use latest Obsidian version, CentOS 7.7 and Nginx.
 
Last edited:
I made it at domain level. Added in additional nginx directives.

Code:
location ~ \.(gif|png|jpeg|jpg|svg|webp)$ {
    valid_referers none blocked ~.google. ~.bing. ~.yahoo. mydomain.com;
    if ($invalid_referer) {
        return   403;
    }
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|woff2|ttf|webp)$ {
    expires 365d;
}

In this case hotlinkprotection works but not expires header.
 
Back
Top