2
我正在閱讀nginx的文檔,但我不知道'(?)'在這個正則表達式中做了什麼。這是什麼意思這個'(?U)'在nginx正則表達式
http://wiki.nginx.org/HttpFastcgiModule#fastcgi_split_path_info
下面是一個例子。腳本show.php接收字符串文章/ 0001作爲參數。下面的配置將妥善處理路徑分離:
location ~ ^.+\.php {
(...)
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
(...)
}
請求/show.php/article/0001設置SCRIPT_FILENAME到/path/to/php/show.php和PATH_INFO來/條/ 0001。
這個正則表達式是不夠的?
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
感謝