LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-14-2014, 07:47 AM   #1
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 176

Rep: Reputation: 18
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.
 
Old 02-14-2014, 12:22 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,257

Rep: Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689Reputation: 1689
You may use the following:
Code:
location /store/ {
 alias  /var/store/categories/;
  location ~ \.jpg$ {
   allow all;
  }
 deny all;
}
 
1 members found this post helpful.
Old 02-18-2014, 07:02 AM   #3
markotitel
Member
 
Registered: Feb 2009
Location: Titel - Serbia
Posts: 176

Original Poster
Rep: Reputation: 18
thanks this is working for now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx location, return and rewrite directives roo4 Linux - Server 0 12-06-2013 09:44 AM
Proper location to upload nginx hosted website? vatin Linux - Server 1 06-20-2013 07:14 PM
LXer: Google I/O Android News: Location, Location, Location (Plus Cloud Messaging and Bluetooth) LXer Syndicated Linux News 0 06-05-2013 01:00 PM
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration