99精品国产综合久久久久五月天,免费观看欧美大片毛片不用播放器 ,AV无码理论片在线观看免费网站,国产精品国产成人国产三级

Board logo

標(biāo)題: [求助] v3配置nginx虛擬目錄支持php的方法 [打印本頁]

作者: toudu    時間: 2017-2-10 20:03     標(biāo)題: v3配置nginx虛擬目錄支持php的方法

服務(wù)器用的是wdcp v3,環(huán)境選擇的是nginx+apache

最近工作需要,需要給一個網(wǎng)站配置虛擬目錄。
nginx配置虛擬目錄并且支持php,用的是alias。


比如在targeta.com的conf文件中配置。
targeta.com的路徑是 /www/web/targeta_com/public_html/
我想把targetb.com的一個目錄指向targeta.com,即http://targeta.com/test訪問的實際目錄是http://targetb.com/test
targeta.com的nginx配置文件添加location
location /test/ {
               alias  /www/web/targetb_com/public_html/test/;
        }


這樣,靜態(tài)文件訪問是成功的,但是不支持php,為了支持php文件,我找了資料。


location ~ /test/.+\.php$ {
           root /data1/;
           rewrite /test/(.*\.php) /$1 break;
           include fastcgi_params;
           fastcgi_pass  unix:/tmp/php-fcgi.sock;
           fastcgi_index index.php;
           fastcgi_param SCRIPT_FILENAME /data1/test/$fastcgi_script_name;
}


在v3,支持php我看是這樣

        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }


那么在nginx的conf中特定目錄支持php應(yīng)當(dāng)怎么寫?
我也試圖這樣跳轉(zhuǎn)

location ~ /test/.+\.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
}


但是不成功,請問需要怎樣做?


謝謝




歡迎光臨 WDlinux官方論壇 (http://fudaan.com/bbs/) Powered by Discuz! 7.2