Welcome! Log In Create A New Profile

Advanced

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

November 24, 2009 01:14PM
Igor,

Thanks. My ultimate goal is to have the flexibility to inspect the incoming uri and make decisions as to what backend host to send the request to.

For instance,

I might want

Incoming URI /johndesp/([a-z] {1}) ----> proxy_pass http://host1/johndesp/whatever

Incoming URI /johndesp/([0-9] {1}) ----> proxy_pass http://host1/johndesp/whenever

example

/johndesp/b ---------------- proxy_pass http://host1:8080/johndesp/whatever * notice this is not http://host1:8080/johndesp/whatever/b

likewise I would want the following:

johndesp/5 ---------------- proxy_pass http://host2:8080/johndesp/whenever * notice this is not http://host1:8080/johndesp/whatever

I tried to use the following..however, I did not get the desired result:

location "~* ^/johndesp/whatever/([a-z] {1}"{
proxy_pass http://host1:8080/johndesp/whatever;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}

but I get this error:
[emerg]: the using of the regex " ^/johndesp/whatever/([a-z] {1}" requires PCRE library in /usr/local/nginx/nginx.conf:43
Subject Author Posted

Can not configure pcre on CENTOS

johndesp November 24, 2009 10:36AM

Re: Can not configure pcre on CENTOS

Christopher Smith November 24, 2009 10:50AM

Re: Can not configure pcre on CENTOS

Igor Sysoev November 24, 2009 11:02AM

Re: Can not configure pcre on CENTOS

Maxim Dounin November 24, 2009 11:08AM

Re: Can not configure pcre on CENTOS

johndesp November 24, 2009 11:50AM

unknown directive "if" in /usr/local/nginx/nginx.conf

johndesp November 24, 2009 12:08PM

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

Maxim Dounin November 24, 2009 02:20PM

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

Igor Sysoev November 24, 2009 12:58PM

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

Mark Maunder November 24, 2009 01:14PM

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

johndesp November 24, 2009 01:14PM

Re: unknown directive "if" in /usr/local/nginx/nginx.conf

Igor Sysoev November 24, 2009 04:10PM

Thanks for all your Help -

johndesp November 25, 2009 05:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 58
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 185 on January 31, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready