rewrite

Vasyl Kondrashov vasyl.kondrashov at gmail.com
Mon Sep 8 14:21:38 MSD 2008


 Пытаюсь перевести rewrite из:
#________________________________________________________________________________________
            RewriteEngine on
            RewriteCond %{REQUEST_URI}            ^/server-status$ [OR]
            RewriteCond %{REQUEST_URI}            ^/server-info$ [OR]
            RewriteCond %{REQUEST_URI}            ^/whm-server-status$
            RewriteRule (.*)                      - [L]
            RewriteRule ^$                        index.php  [L]
                        RewriteRule ^sso_endpoint.php/ui$
index.php/SSO/UI [L]
                        RewriteRule ^sso_endpoint.php/SAML$
index.php/SSO/Proxy [L]
                        RewriteRule ^sso_endpoint.php/signout$
index.php/SSO/Proxy [L]
            RewriteCond %{REQUEST_URI}            ^/[a-z]+/.*$
            RewriteCond %{REQUEST_URI}            [^/]$
            RewriteRule (.*)                      -  [L]
            RewriteCond %{REQUEST_FILENAME}       !-f
            RewriteCond %{REQUEST_FILENAME}       !-d
            RewriteRule (.*)                      index.php/$1  [QSA,L]
 #__________________________________________________________________________________________
в понятную nginx форму. Последний вариант:
 #__________________________________________________________________________________________

if ($request_uri ~ ^/server-status$) {
break;
}
if ($request_uri ~ ^/server-info$) {
break;
}
if ($request_uri ~ ^/whm-server-status$) {
break;
}
rewrite ^$ index.php last;
rewrite ^sso_endpoint.php/ui$ index.php/SSO/UI last;
rewrite ^sso_endpoint.php/SAML$ index.php/SSO/Proxy last;
if ($request_uri ~ ^/[a-z]+/.*$) {
break;
}
if ($request_uri ~ [^/]$) {
break;
}
if (!-e $request_filename) {
rewrite  ^/(.*)$  /index.php/$1
break;
}
 #__________________________________________________________________________________________

Перевод не дословный, но не это важно. При попытке открыть адрес
http://server/Login пишет 404 - not found, а по идее - должно rewrite
на http://server/index.php?Login

nginx version: nginx/0.6.31, fast-cgi

Чувствую, что грабли рядом, а никак не найду :(


More information about the nginx-ru mailing list