nginx + php-fpm を使用していますが、'/rest/proccess' にアクセスしようとすると、$_SEVER['REQUEST_URI'] == '/process' が必要です。だから私はnginxのためにそのような設定を作成しました:
location /rest/ {
root /var/www/php;
rewrite ^/rest/(.*)$ /$1 break;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
しかし、それは機能しません。php には $_SEVER['REQUEST_URI'] == '/rest/process' があります。
私が間違っていることは何ですか?
thnx
UPD: 書き換えルールは $document_uri のみを書き換え、$request_uri は書き換えないようです。したがって、$_SEVER['REQUEST_URI'] == '/rest/process' および $_SEVER['DOCUMENT_URI'] == '/process'