• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Nginx + Plesk + Hotlinking

asterixus

New Pleskian
Hi,

I have a problem with Nginx+ Plesk.

I need to stop hotlinkers from embedding pictures from my server, and I use Plesk functionality to add Nginx directive, like this:

location ~* \.(jpg|jpeg|png|gif)$ {
valid_referers none blocked server_names
*.example.com example.* ~\.google\.;
if ($invalid_referer) {
return 403;
}
}

And it does not work, until I remove the location part:

valid_referers none blocked server_names
*.example.com example.* ~\.google\.;
if ($invalid_referer) {
return 403;
}

Now it will work. How can I define a forbidden filetype in this case?

I am stuck on this, I appreciate any help!

Thanks!
 
Back
Top