

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in ru.sysoev.nginxRe: Hello| From | Sent On | Attachments |
|---|---|---|
| Mansoor Peerbhoy | Jul 23, 2007 2:03 am | |
| Igor Sysoev | Jul 23, 2007 2:45 am | |
| Mansoor Peerbhoy | Jul 23, 2007 2:53 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Hello | Actions... |
|---|---|---|
| From: | Mansoor Peerbhoy (mans...@public.gmane.org) | |
| Date: | Jul 23, 2007 2:53:12 am | |
| List: | ru.sysoev.nginx | |
Fantastic, thank you !
I was looking for something like that.
Regards, Mansoor Peerbhoy
----- Original Message ----- From: "Igor Sysoev" <is-G...@public.gmane.org> To: nginx-nofU2znGi42HXe+LvDL...@public.gmane.org Sent: Monday, July 23, 2007 3:15:29 PM (GMT+0530) Asia/Calcutta Subject: Re: Hello
On Mon, Jul 23, 2007 at 02:03:31AM -0700, Mansoor Peerbhoy wrote:
Anyway, a quick question:
I am using NGINX as an HTTP (reverse) proxy, and I need to conditionally
redirect some URLs to an external FASTCGI server.
I have read the HTTP rewrite module documentation at
http://wiki.codemongers.com/NginxHttpRewriteModule and I see that there are ways
to conditionally rewrite certain URLs.
I wonder if there is any complete set of NGINX variables ( A sort of NGINX
variable reference ) that I can refer to ?
The reason I ask for such a reference is, because the conditions for a rewrite,
in my case, are rather complicated.
The most of nginx variables has the same names as in Apache.
http://wiki.codemongers.com/NginxHttpCoreModule#variables
For instance, I should like to say:
. If URL begins with /xxxx/ AND if the HTTP method is POST, AND if there is no
cookie named CCCC in the HTTP header, then redirect the url to /abc/def/
otherwise let it fall through to the default handler.
I wonder if this is possible using the syntax described at
http://wiki.codemongers.com/NginxHttpRewriteModule
The ngx_http_rewrite_module currently has many limits and drawbacks.
You may try the following:
location /xxxx/ { set $test "";
if ($request_method = POST) { set $test P; }
if ($http_cookie ~* "CCCC=.+(?:;|$)" ) { set $test ${test}C"; }
if ($test = PC) { fastgci_pass ...; }
# you have to set fastcgi_param at this level, # however, it does not mean that request goes to fastcgi
fastcgi_param ...; fastcgi_param ...; fastcgi_param ...;
... }
-- Igor Sysoev http://sysoev.ru/en/







