nginx的rewrite問題 - Linux

Table of Contents

各位好
我正在練習怎麼使用nginx
我現在遇到一個問題 不知道怎麼解決 懇請大大幫忙

問題:
網址: http://tw.kimo.com/aa/bb/cc.html
我希望讓使用者可以不用填寫html

所以我寫了如下
location / {
try_files $uri$args $uri$args/ $uri/ $uri.html /index.html;
}
使用者如果輸入
http://tw.kimo.com/aa/bb/cc
是如我所要的轉到cc.html

可是如果他填寫
http://tw.kimo.com/aa/bb/cc/
卻會轉到index.html

請問我應該怎麼樣改寫才能抓到 / 結尾的所有結果呢??

--
上聯:食有農藥蔬菜病死雞
下聯:住有輻射鋼筋海砂屋
橫批:寶島台灣

--

All Comments