nginx虛擬目錄支持PHP,大家有解決的嗎?
nginx 配置虛擬目錄,虛擬目錄不支持PHP了,大家知道怎麼解決嗎?
搜了很多,一直沒有解決的,我的版本是nginx7.05的
《解決方案》
啟用FastCGI,安裝php-fpm
《解決方案》
樓上的兄的,我裝了,支持PHP,我的意思是在裡面配置文件裡面加入虛擬目錄 alias這樣的,虛擬目錄裡面的就不支持PHP了
《解決方案》
nginx.conf 沒配置好吧
《解決方案》
在alias之後的目錄再定義下php解析
《解決方案》
回復 #5 godamen 的帖子
對了, 對於每個目錄都要location *** 定義下的~
《解決方案》
server
{
listen 80;
server_name www.xxx.com;
index index.html index.htm index.php;
root /ftpdata/ftp/cc/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location /jsp {
root /ftpdata/ftp/xxx/jsp;
index index.jsp;
proxy_pass http://127.0.0.1:8080;
}
location ^~ /aa {
alias /home/aa/;
}
access_log /ftpdata/nginx/logs/xxx.com.log wwwlogs;
}
幫嗎看一下
《解決方案》
原帖由 一刀砍死 於 2009-5-11 13:23 發表 http://bbs3.chinaunix.net/images/common/back.gif
對了, 對於每個目錄都要location *** 定義下的~
server
{
listen 80;
server_name www.xxx.com;
index index.html index.htm index.php;
root /ftpdata/ftp/cc/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location /jsp {
root /ftpdata/ftp/xxx/jsp;
index index.jsp;
proxy_pass http://127.0.0.1:8080;
}
location ^~ /aa {
alias /home/aa/;
}
access_log /ftpdata/nginx/logs/xxx.com.log wwwlogs;
}
幫忙修改一下,看看那,謝謝
《解決方案》
location ~ .*\.(php|php5)?$
你就照著這個把php|php5 改成jsp不就完了,沒學過正則:shock:
《解決方案》
回復 #9 一刀砍死 的帖子
location ~ ^/ftpdata/ftp/xxx/.*\.jsp$