• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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