若將 Zend Framework 移到 nginx,原本的 htaccess 會沒有作用,可將規則改寫在 nginx 的網站設定檔中。
# 判斷網址的路徑,是否真的有此檔案,沒有就交給後面的@my_zf (fallback)處理
try_files $uri @my_zf;
location @my_zf {
fastcgi_pass unix:/tmp/php-fcgi.sock;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/index.php;
include fastcgi_params;
}
參考:
http://stackoverflow.com/a/4470469
http://wiki.nginx.org/HttpCoreModule#try_files
http://wiki.nginx.org/Zend_Framework
沒有留言:
張貼留言