# Sanity check of my config - is it secure?

**URL:** <https://www.ruby-forum.com/t/sanity-check-of-my-config-is-it-secure/207281>\
**Category:** NGINX\
**Created:** [May 22, 2011, 4:57pm UTC](https://www.ruby-forum.com/t/sanity-check-of-my-config-is-it-secure/207281 "2011-05-22T16:57:16Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![benseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@benseb](https://www.ruby-forum.com/u/benseb)\
**Post date:** [May 27, 2011, 7:41am UTC](https://www.ruby-forum.com/t/sanity-check-of-my-config-is-it-secure/207281/21 "2011-05-27T07:41:21Z")

</div>

On Thu, May 26, 2011 at 04:10:23PM -0400, benseb wrote:

> Thanks people
> 
> So there’s no way to say “If the file ISNT a jpeg/gif/css/js” deny. The  
> only way is to say ‘if .php’ deny, ‘if .txt deny’ etc?
> 
> I’d prefer to whitelist the files i DO want to return and block  
> everything else, incase I forget something to block?

As it was already suggested:

location ~\* .(jpe?g|png|gif)$ {  
root …  
}

location / {  
return 444;  
}

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![benseb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@benseb](https://www.ruby-forum.com/u/benseb)\
**Post date:** [May 27, 2011, 7:39am UTC](https://www.ruby-forum.com/t/sanity-check-of-my-config-is-it-secure/207281/22 "2011-05-27T07:39:30Z")

</div>

On Sun, May 22, 2011 at 05:48:42PM +0100, Nuno Magalhes wrote:

> ^~ /(applets|css)/  
> The lesser regex locaitons you have in configuraiton is the better.  
> The best case is zero regex locations.

–  
Igor S.

[Previous page](https://www.ruby-forum.com/t/sanity-check-of-my-config-is-it-secure/207281.md?page=1)
