Welcome! Log In Create A New Profile

Advanced

RegExp not works

Posted by nams 
RegExp not works
December 14, 2010 08:02AM
Hi,

I'm trying to setup a location config using regexp but it seems to not work.
I need to cache all http requests that starts with: /app/v1/service/try/ and contains "method=getServiceName".

Example: http://mydomaine.com/app/v1/service/try/?param1=val1&param2=val2&method=getServiceName&param3=val3

I used the following config:

location ~* /app/v1/service/try/(.*)getServiceName(.*) {
proxy_pass http://localhost:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_headers Expires;
proxy_ignore_headers Cache-Control;
proxy_cache_valid 200 301 302 12h;
expires 12h;
proxy_cache mycachename;
}

I see in logs:
*233 test location: "/"
2010/12/14 13:44:03 [debug] 26370#0: *233 test location: "50x.html"
2010/12/14 13:44:03 [debug] 26370#0: *233 test location: ~ "/app/v1/service/try/(.*)getServiceName(.*)"
2010/12/14 13:44:03 [debug] 26370#0: *233 using configuration "/"

Thank you in advance for your help.
Re: RegExp not works
December 20, 2010 06:24AM
Please help :)

Have a good day.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready