# How to define location to math all .php files with authentication?

**URL:** <https://www.ruby-forum.com/t/how-to-define-location-to-math-all-php-files-with-authentication/195274>\
**Category:** NGINX\
**Created:** [September 20, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/how-to-define-location-to-math-all-php-files-with-authentication/195274 "2010-09-20T22:55:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flavio\_Torres](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@Flavio\_Torres](https://www.ruby-forum.com/u/Flavio_Torres)\
**Post date:** [September 20, 2010, 10:55pm UTC](https://www.ruby-forum.com/t/how-to-define-location-to-math-all-php-files-with-authentication/195274/1 "2010-09-20T22:55:44Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi all,

Please, how can I define a location to math all .php files ?

Actually, I’m using the following configuration:

> **[server { listen localhost:8090; server\_name .flaviotorre...](https://pastebin.com/RMWWGD4a)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

As you can see, I had to define (line 42) a location ~.php$ { … }  
inside (line 39) location ~\* /test { … } with authentication. It  
worked for me, but, this is the best way ?

Thank you guys!  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.10 (GNU/Linux)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org/](http://enigmail.mozdev.org/)

iEYEARECAAYFAkyXyiYACgkQNRQApncg295WYgCdF7aDie4su51bPWIqHtbfErsX  
GrkAmwcTzbMtOF/Qt1RUpZQKuR9LJIKE  
=0Y+a  
-----END PGP SIGNATURE-----
