Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Aug 06, 2010 10:10 am 
Offline
Senior Newbie

Joined: Sat Mar 27, 2010 12:32 am
Posts: 6
Hi,

I have a folder which is /generator/data ... The data folder has 777 permissions and inside the data folder i have a .htaccess file with thw following syntax:

Code:
order deny,allow

deny from all
<Files ~ "\.(txt|html|gz)$">
allow from all
</Files>


This .htaccess rule blocks access to the /generator/data for everyone EXCEPT for files with extensions .txt , .html , .gz ....

The problem is i am using NGINX as my Webserver and not Apache. I know that i have to update somehow my Virtual Host file for my domain. Can someone help me to convert this simple Apache rule into NGINX syntax???

Thanks in advance

George


Top
   
 Post subject:
PostPosted: Fri Aug 06, 2010 4:36 pm 
Offline
Senior Member
User avatar

Joined: Sun Mar 23, 2008 10:10 am
Posts: 71
Website: http://frontseed.com/
You will have to place location directives into your server section. Something like:
Code:
location ~* ^/generator/data/(.*)\.(txt|html|gz)$ {
  allow all;
}
location /generator/data {
  deny all;
}

The ordering of location directives is important, you can read about this here


Top
   
 Post subject:
PostPosted: Fri Aug 06, 2010 5:44 pm 
Offline
Senior Newbie

Joined: Sat Mar 27, 2010 12:32 am
Posts: 6
melon wrote:
The ordering of location directives is important, you can read about this here


Thank you very much for your help. What do you mean with "The ordering of location directives is important"???

Thanks

George


Top
   
 Post subject:
PostPosted: Fri Aug 06, 2010 6:14 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
follow the link melon posted..
To summarize, the order in which directives are checked is as follows:

Directives with the "=" prefix that match the query exactly. If found, searching stops.
All remaining directives with conventional strings. If this match used the "^~" prefix, searching stops.
Regular expressions, in the order they are defined in the configuration file.
If #3 yielded a match, that result is used. Otherwise, the match from #2 is used.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group