# Can I really assume location match start with /?

**URL:** <https://www.ruby-forum.com/t/can-i-really-assume-location-match-start-with/224371>\
**Category:** NGINX\
**Created:** [November 9, 2012, 5:01am UTC](https://www.ruby-forum.com/t/can-i-really-assume-location-match-start-with/224371 "2012-11-09T05:01:07Z")\
**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:** [November 9, 2012, 5:01am UTC](https://www.ruby-forum.com/t/can-i-really-assume-location-match-start-with/224371/1 "2012-11-09T05:01:07Z")

</div>

From the doc, it said…

==========

location / {

# matches any query, since all queries begin with /, but regular

==========

But I am wondering, if it always start with /, why not use ^ instead?

e.g.

location ^/ {  
location ^/documents/ {

---

<div class="post-metadata">

**Author:** ![mindel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@mindel](https://www.ruby-forum.com/u/mindel)\
**Post date:** [November 9, 2012, 5:02am UTC](https://www.ruby-forum.com/t/can-i-really-assume-location-match-start-with/224371/2 "2012-11-09T05:02:53Z")

</div>

On Fri, Nov 9, 2012 at 11:00 AM, Ryan C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

That’d require regexp.
