第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Nginx如何使用一個域名配置多個目錄

Nginx如何使用一個域名配置多個目錄

紅糖糍粑 2019-05-10 11:36:06
server{listen*:80;server_nameadmin.hiphop.top;location/{root"D:\Office\PHPStudy\PHPTutorial\WWW\MyWork\VhiphopAdmin\dist";indexindex.html;try_files$uri$uri//index.html;}location/api{root"D:\Office\PHPStudy\PHPTutorial\WWW\MyWork\VhiphopAdminApi\public";indexindex.php;try_files$uri$uri//index.php?$query_string;}location~\.php(.*)${fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_split_path_info^((?U).+\.php)(/?.+)$;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;includefastcgi_params;}}配置代碼如上訪問admin.hiphop.top可以匹配到"D:OfficePHPStudyPHPTutorialWWWMyWorkVhiphopAdmindist"訪問admin.hiphop.top/api不能匹配到"D:OfficePHPStudyPHPTutorialWWWMyWorkVhiphopAdminApipublic"dist目錄是我的前端靜態(tài)文件,public目錄是phpapi接口的入口目錄請問如何配置才能做到訪問admin.hiphop.top/*時匹配dist目錄并且訪問admin.hiphop.top/api優(yōu)先匹配php的public目錄配置2個域名是沒問題的因為瀏覽器有跨域問題,所以現(xiàn)在想只用一個域名
查看完整描述

2 回答

?
慕婉清6462132

TA貢獻(xiàn)1804條經(jīng)驗 獲得超2個贊

問題已經(jīng)解決了在最后一個.php匹配規(guī)則里面加上root就可以了
location~\.php(.*)${
root"D:\Office\PHPStudy\PHPTutorial\WWW\MyWork\VhiphopAdminApi\public";
indexindex.php;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_split_path_info^((?U).+\.php)(/?.+)$;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
                            
查看完整回答
反對 回復(fù) 2019-05-10
  • 2 回答
  • 0 關(guān)注
  • 2489 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號