| From | Sent On | Attachments |
|---|---|---|
| Wilson Bilkovich | Apr 2, 2007 4:40 am | |
| Igor Sysoev | Apr 2, 2007 5:25 am | |
| Wilson Bilkovich | Apr 2, 2007 12:14 pm | |
| Igor Sysoev | Apr 2, 2007 12:46 pm | |
| Wilson Bilkovich | Apr 2, 2007 12:54 pm | |
| Igor Sysoev | Apr 2, 2007 1:19 pm | |
| Wilson Bilkovich | Apr 2, 2007 2:10 pm | |
| Igor Sysoev | Apr 2, 2007 2:26 pm | |
| Wilson Bilkovich | Apr 2, 2007 4:27 pm | |
| Boris Bartsyts | Apr 10, 2007 8:07 am | |
| Igor Sysoev | Apr 10, 2007 12:59 pm | |
| Boris Bartsyts | Apr 11, 2007 3:42 am | |
| Igor Sysoev | Apr 12, 2007 1:28 pm |
| Subject: | Re: string and variable concat in -f checks | |
|---|---|---|
| From: | Igor Sysoev (is-G...@public.gmane.org) | |
| Date: | Apr 12, 2007 1:28:55 pm | |
| List: | ru.sysoev.nginx | |
On Wed, Apr 11, 2007 at 01:42:31PM +0300, Boris Bartsyts wrote:
thanks Igor, i've ended up with this:
rewrite ^(.*)/$ $1/index.html;
if (-f $document_root/cache$uri) { root /var/www/myspace/cache; break; }
rewrite ^(.*)/index.html$ $1/index.php;
... further rewrite rules here ...
i couldn't get rid of additional rewrites for index.html "index index.html index.php" doesn't help because i have index.php only in /root and index.html only in /root/cache folder.
I think it's better to use such configuration:
location / { root /var/www/myspace/cache; index index.html; error_page 404 = /miss; }
location = /miss { proxy_pass http://backend;
# do not write any URI part after "http://backend" !!! # then proxy_pass gets original client URI, but not "/miss" }
On Wed, 2007-04-11 at 00:00 +0400, Igor Sysoev wrote:
On Tue, Apr 10, 2007 at 06:08:18PM +0300, Boris Bartsyts wrote:
is it possible to do something like this:
if (-f /cache$request_filename) { rewrite ^(.*)$ /cache$1; }
it should check for the requested file in the /cache dir and if it doesn't exist proceed to remaining rewrite rules. i can't make this clause working, please correct it or point to other soultions.
$request_file is "$document_root$uri". If this is what you suggest, then you should use
location / {
root /data/w3;
if (-f /cache$request_filename) {
root /cache/data/w3; break; } }
-- Игорь Сысоев http://sysoev.ru





