nginx-ruニュースレターのIgor Sysoevは次のように書いています。
先日、リクエストをDrupalなどにリダイレクトする方法を考えていました。
そのため、Apachevタイプの構築
RewriteCond%{REQUEST_FILENAME}!-F
RewriteCond%{REQUEST_FILENAME}!-D
RewriteRule ^(。*)$ Index.php?Q = $ 1 [L、QSA]
やり直す必要はありません
場所/ {
if(!$ request_file){
書き換える^(。*)/index.php?q=$1 last;
}
}
ロケーション= /index.php {
fastcgi ...
}
ではなく
場所/ {
error_page 404 = /index.php?q=$request_uri;
}
ロケーション= /index.php {
fastcgi ...
}
しかし、これで:
場所/ {
error_page 404 = drupal ;
}
場所= drupal {
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
fastcgi_param QUERY_STRING q = $ request_uri;
fastcgi ...
}