• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Resolved Unable to block folders in Plesk with nginx

Azurel

Silver Pleskian
Plesk Onyx Version 17.0.17 Update #28

Its a CDN domain for images and I want block images for a spezific folder, so I add:

location ~* /myfolder1/(a|b|c)/ {
deny all
return 403
}

Thats never will happen, but why? Is here a problem with nginx.conf for this domain, because:
server {
location / {
}

location @fallback {
}

location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip))$ {
try_files $uri @fallback;
}

include "/var/www/vhosts/system/cdn.example.com/conf/vhost_nginx.conf";
}

What can I do?
 
Last edited:
Is this a bug? Can I report it? Is here a Workaround? I think the include must set before @fallback in nginx.conf.

Here is a small issue in default plesk nginx.conf it should be
location ~* ^/........... (~* means case-insensitive regular expression match)
Actual its only catch file types with lowercase, not "Jpg" or "JPG" or "TXT", .....

and why
^/(.*\.(ac3|avi|.......
ant not only?
\.(ac3|avi|.......


EDIT: This topic was moved from "Plesk Onxy for Linux". Because I think this is a important issue in plesk onyx, I create there a new topic. This topic can be deleted.
https://talk.plesk.com/threads/its-...-types-in-additional-nginx-directives.343909/
 
Last edited:
Back
Top