# Location regular expression explanation

**URL:** <https://www.ruby-forum.com/t/location-regular-expression-explanation/221878>\
**Category:** NGINX\
**Created:** [August 3, 2012, 8:28am UTC](https://www.ruby-forum.com/t/location-regular-expression-explanation/221878 "2012-08-03T08:28:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 3, 2012, 8:28am UTC](https://www.ruby-forum.com/t/location-regular-expression-explanation/221878/1 "2012-08-03T08:28:46Z")

</div>

Hi,

I was recently reading the PHPfastcgi example at  
[PHP FastCGI Example | NGINX](http://wiki.nginx.org/PHPFcgiExample). When it talks about the  
configuration to avoid the exploit on uploads folder, there is a  
regulare expresion saying: location ~\*  
(^(?!(?:(?!(php|inc)).)_/blogs.dir/)._?(php|inc)) {

I don’t understand that regular expresion. Could someone explain me what  
?! ?: mean or send me some link to documentation about this?? I cannot  
find anything after some googling.

Thanks and regards.

Posted at Nginx Forum:

> **[Location regular expression explanation](https://forum.nginx.org/read.php?2,229276,229276#msg-229276)**
>
> Hi, I was recently reading the PHPfastcgi example at http://wiki.nginx.org/PHPFcgiExample. When it talks about the configuration to avoid the exploit on uploads folder, there is a regulare expresion saying: location ~\*...

---

<div class="post-metadata">

**Author:** ![diego\_xa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@diego\_xa](https://www.ruby-forum.com/u/diego_xa)\
**Post date:** [August 3, 2012, 9:17am UTC](https://www.ruby-forum.com/t/location-regular-expression-explanation/221878/2 "2012-08-03T09:17:56Z")

</div>

On Fri, Aug 03, 2012 at 02:28:09AM -0400, diego\_xa wrote:

> find anything after some googling.
> 
> Thanks and regards.

[http://www.pcre.org/pcre.txt](http://www.pcre.org/pcre.txt)
