1
我添加指令的此塊到我的Nginx的安裝Nginx的重寫和FastCGI - PHP文件獲取下載
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass unix:/var/run/php5-fpm.sock;
# With php5-fpm:
include fastcgi.conf;
fastcgi_index index.php;
}
如果我聯繫http://myserverip/script.php一切順利。 我需要使用重寫引擎重寫某些網址後,指令該塊我已經添加了許多其他塊這樣的:
location = /sentmessages {
rewrite ^(.*)$ /sent_messages.php break;
}
(我用的.htaccess規則winginx轉換器)
如果我聯繫http://myserverip/sentmessages重寫進行的很順利,但PHP腳本被下載而不是傳遞給FastCGI。 我不知道如何解決這個問題(試圖改變指令順序沒有成功。)
如何解決?謝謝。
刪除'break'並閱讀文檔 –
修復了這個問題。謝謝。 –