15 messages in ru.sysoev.nginxRe: php and locations with regex (rou...
FromSent OnAttachments
Alejandro VartabedianOct 23, 2007 3:43 am 
Alejandro VartabedianOct 23, 2007 7:16 am 
Igor SysoevOct 23, 2007 7:29 am 
Maxim DouninOct 23, 2007 7:33 am 
Alejandro VartabedianOct 23, 2007 7:42 am 
Alejandro VartabedianOct 23, 2007 7:44 am 
Alejandro VartabedianOct 23, 2007 8:37 am 
Grzegorz NosekOct 23, 2007 8:43 am 
Alejandro VartabedianOct 23, 2007 9:25 am 
Igor SysoevOct 23, 2007 9:33 am 
Alejandro VartabedianOct 23, 2007 10:55 am 
Grzegorz NosekOct 24, 2007 1:31 am 
Igor SysoevOct 24, 2007 3:00 am 
Igor SysoevOct 24, 2007 3:23 am 
Alejandro VartabedianOct 24, 2007 5:40 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: php and locations with regex (round 2)Actions...
From:Alejandro Vartabedian (list@public.gmane.org)
Date:Oct 23, 2007 10:55:49 am
List:ru.sysoev.nginx

Igor Sysoev escribió:

On Tue, Oct 23, 2007 at 02:26:10PM -0200, Alejandro Vartabedian wrote:

;-) i tried something like this before posting the last mail, but i think this mixture is out of context (somebody correct me please), it's a rewrite module directive, and fastcgi params doesn't fit in it (yet ;).

i think i'm out of luck with the simplification/generalization of the config directives i pretend.

thank you all, i'm learning a lot about nginx...

You may use:

location ~ \.php$ { fastcgi_pass ... ... }

location ~ ^/(app1|app2)/ { root ... ... }

Igor, you'll not trust me, but i remember to have proven something like these, i think in the config test madness i missed something or didn't cleared the browser cache correctly and discarded those settings. it seems to work ok!

It's better do not use "if".

what about conditioned rewrite rules application, the same advice?

Try to route request via locations only. If you want to pass non-existent files to FastCGI/proxy it's better to use:

location / { root ... error_page 404 = @fallback; }

location @fallback { fastcgi_pass ... ... }

those are very elegant and powerful options to remember for other things. question: is the return directive (from rewite module) applicable in this behavior to trigger @fallback?

thanks for all.