Data publikacji: Mar 26, 2010 5:27:24 PM
Dość ciekawy (upierdliwy?) problem.
server {
# 1
location / {
try_files $uri $uri/ @root;
}
location @root {
rewrite ^/(.*)$ /index.php?kohana_uri=$1&$args last;
}
location /images {
try_files $uri $uri/ @images;
}
# 3
location @images {
set $url /images.php?param=$request_uri;
rewrite ^(.*)$ $url last;
}
# 2
location ~ \.php($|/) {
...
}
}
Wywołanie /images/costam, które powinno wywołać skrypt images.php z parametrem param=$request_uri. Niestety, nginx przepisuje poprawnie, lecz pozniej obsługuje /images.php?... poprzez location (1) a nie location (2). Jeżeli w location (3) zrobię:
set $param param=$request_uri;
rewrite ^(.*)$ /images.php?$param&$args;
to wszystko działa poprawnie, tj. /images.php jest obsługiwany przez location (2).
Dziwne. Nginx 0.7.65.