nginx: regex not matching URI

i have this URI /orls/myservice/f?p=4550 and the following location

location ~ "^/(.+)/myservice/f?p=(.+)$" {
 .....
}

nginx is returning a 404 not found. the problem might come from the ? so i tried \? buit i’m still getting the same error. Can anyone help ?

Answer

The location match does not consider the query string:

Note that locations of all types test only a URI part of request line 
without arguments. This is done because arguments in the query string 
may be given in several ways [...]

http://nginx.org/en/docs/http/request_processing.html

Attribution
Source : Link , Question Author : skip87 , Answer Author : asdmin

Leave a Comment