LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   nginx location access permissions (https://www.linuxquestions.org/questions/linux-server-73/nginx-location-access-permissions-4175494903/)

markotitel 02-14-2014 07:47 AM

nginx location access permissions
 
Hi,

I have this location setup in order this link is accessibile http://domain.com/store/office/img.jpg

Code:

location /store/ {
    alias  /var/store/categories/;
  }

/var/store/categories/ contain directories with images, html and json files.
How can I setup this config to allow access to visitors only to images.

bathory 02-14-2014 12:22 PM

You may use the following:
Code:

location /store/ {
 alias  /var/store/categories/;
  location ~ \.jpg$ {
  allow all;
  }
 deny all;
}


markotitel 02-18-2014 07:02 AM

thanks this is working for now :)


All times are GMT -5. The time now is 02:25 AM.