28 messages in ru.sysoev.nginxRe: Location problems
FromSent OnAttachments
Matteo NiccoliFeb 19, 2008 1:37 am 
Denis F. LatypoffFeb 19, 2008 2:22 am 
Matteo NiccoliFeb 19, 2008 2:38 am 
Igor ClarkFeb 19, 2008 3:04 am 
Denis F. LatypoffFeb 19, 2008 3:23 am 
Igor ClarkFeb 28, 2008 11:41 am 
Igor SysoevFeb 28, 2008 12:49 pm 
Igor ClarkFeb 29, 2008 1:38 am 
Igor SysoevFeb 29, 2008 2:41 am 
Igor ClarkFeb 29, 2008 3:13 am 
Igor SysoevFeb 29, 2008 3:30 am 
Igor ClarkFeb 29, 2008 7:36 am 
Cliff WellsFeb 29, 2008 11:20 pm 
Igor SysoevFeb 29, 2008 11:47 pm 
Igor ClarkMar 3, 2008 6:07 am 
Igor SysoevMar 3, 2008 6:15 am 
Igor ClarkMar 3, 2008 8:52 am 
Igor SysoevMar 3, 2008 8:55 am 
Igor ClarkMar 3, 2008 9:43 am 
Igor SysoevMar 3, 2008 9:49 am 
Igor ClarkMar 4, 2008 6:13 am 
Igor ClarkMar 6, 2008 9:40 am 
Igor SysoevMar 8, 2008 12:05 pm 
Igor ClarkMar 10, 2008 3:04 am 
Igor SysoevMar 10, 2008 3:28 am.method
Igor ClarkMar 10, 2008 3:51 am 
Igor ClarkMar 31, 2008 11:14 am.conf, .conf, .log
Igor ClarkApr 7, 2008 3:04 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: Location problemsActions...
From:Igor Clark (igor@public.gmane.org)
Date:Feb 29, 2008 7:36:21 am
List:ru.sysoev.nginx

Thanks very much Igor, that's really helpful, and shows a completely different approach from the one I've been taking. Excellent stuff.

Igor

On 29 Feb 2008, at 11:31, Igor Sysoev wrote:

On Fri, Feb 29, 2008 at 11:13:48AM +0000, Igor Clark wrote:

Hi Igor,

Everything that doesn't exist as a file gets routed to either / frontend.php, or /admin.php if the URI starts with /admin. If so, it's IP-restricted in this case, basic_auth protected in other cases.

So we want to be able to do:

/ -> /frontend.php -> fastcgi

/speakers/show/all -> /frontend.php?control_path=/speakers/show/all -> fastcgi

/admin -> /admin.php -> fastcgi, protected

/admin/speakers/edit/32 /admin.php?control_path=/admin/speakers/edit/ 32 -> fastcgi, protected

I'm just wondering whether our approach of "rewrite first, then deal with locations" is just wrong, maybe we should deal with locations first and then rewrite if necessary.

location / { error_page 404 = @fallback; }

location @fallback { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/frontend.php; fastcgi_param QUERY_STRING control_path=$uri; ... }

location /admin { allow 1.2.3.4; deny all; error_page 404 = @admin; }

location @admin { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/admin.php; fastcgi_param QUERY_STRING control_path=$uri; ... }