国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

Mac M1 Nginx 配置多站點(diǎn)的實(shí)現

發(fā)布時(shí)間:2021-08-15 18:37 來(lái)源: 閱讀:0 作者:老掌 欄目: 服務(wù)器 歡迎投稿:712375056

說(shuō)明: 通過(guò) brew 安裝的 nginx

網(wǎng)站根目錄: /opt/homebrew/var/www

nginx 配置目錄: /opt/homebrew/etc/nginx/

假設: 有項目名稱(chēng)為 TestProject , 域名為 bd.testproject.com

第一步 : 設置 IP 與 域名 映射 (也就是增加 hosts)

# 終端
vim /etc/hosts 
 
# 增加保存
127.0.0.1  bd.testproject.com

 第二步 : 新建站點(diǎn)配置文件目錄

# 終端
mkdir /opt/homebrew/etc/nginx/vhosts

第三步 : 新建站點(diǎn)配置文件

在 /opt/homebrew/etc/nginx/vhosts 目錄中新建名為 bd.testproject.com_80.conf 配置文件 , 配置文件內容為(可根據自需更改配置內容):

server {
    listen    80;
    server_name bd.testproject.com;
    root  "/opt/homebrew/var/www/bd.testproject.com";
    location / {
      index index.php index.html error/index.html;
 
      autoindex off;
    }
    location ~ \.php(.*)$ {
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param PATH_INFO $fastcgi_path_info;
      fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
      include    fastcgi_params;
    }
}

第四步 : 在 nginx 默認配置文件中引入站點(diǎn)配置

# 終端
vim /opt/homebrew/etc/nginx/nginx.conf
 
# 在文件內 http{} 中新增
server_names_hash_bucket_size 64; # 修改服務(wù)器名稱(chēng)長(cháng)度,只能為 32 的倍數
include /opt/homebrew/etc/nginx/vhosts/*; # 引入站點(diǎn)配置

第五步 : 重啟 nginx

# 終端
nginx -s reload

請忽略我, 啟動(dòng) fastcgi

/usr/local/php/bin/php-cgi -b 9000

到此這篇關(guān)于Mac M1 Nginx 配置多站點(diǎn)的實(shí)現的文章就介紹到這了,更多相關(guān)Mac M1 Nginx多站點(diǎn)內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

欧美人禽ZOZO伦交| 亚洲中文波霸中文字幕| 日韩av无码久久一区二区| 国产成人AV在线免播放观看| 日韩久久无码免费看A| 国产欧美日韩综合精品一区二区|