国产又粗又猛又爽又黄老大爷|国产真实老头老太BBWBBW|国产午夜精品一区二区三区四区|国产做受18~20岁A片|国产CHINESE男男GAY片|久久久天堂国产精品女人

購物車中還沒有商品,趕緊選購吧!

Linux nginx域名綁定方法

發(fā)布日期:2017-10-18 閱讀:7980

以下配置的路徑以阿里云提供的標(biāo)準(zhǔn)環(huán)境路徑為準(zhǔn),如果您另行安裝,請根據(jù)實(shí)際安裝路徑去找到您的配置文件進(jìn)行配置。

       假如我們需要在我們的網(wǎng)站www.test.com上增加綁定一個(gè)m.test.com和一個(gè)test.com的域名,請進(jìn)行如下類似的操作:

1.cd /alidata/server/nginx/conf/vhosts/ 找到您的網(wǎng)站配置文件,一般是您的域名.conf,例如域名是:www.test.com,那就應(yīng)該是www.test.com.conf

 

2.vim www.test.com.conf  修改這個(gè)配置文件,您應(yīng)該會看到如下類似的配置內(nèi)容:

server {

        listen       80;

        server_name www.test.com;

        root /www/web/www_test_com/public_html;

        index index.php;

        error_page  400 /errpage/400.html;

        error_page  403 /errpage/403.html;

        error_page  404 /errpage/404.html;

        location ~ \.php$ {

                proxy_pass http://127.0.0.1:88;

                include naproxy.conf;

        }

        location / {

                try_files $uri @apache;

        }

        location @apache {

                 proxy_pass http://127.0.0.1:88;

                 include naproxy.conf;

        }

        access_log  /www/web_logs/www.test.com_access.log  wwwlogs;

        error_log  /www/web_logs/www.test.com_error.log;

}

 

3.點(diǎn)擊字母“i”開始編輯文件,輸入內(nèi)容:

server {

        listen       80;

        server_name www.test.com test.com m.test.com;

        root /www/web/www_test_com/public_html;

        index index.php;

        error_page  400 /errpage/400.html;

        error_page  403 /errpage/403.html;

        error_page  404 /errpage/404.html;

        location ~ \.php$ {

                proxy_pass http://127.0.0.1:88;

                include naproxy.conf;

        }

        location / {

                try_files $uri @apache;

        }

        location @apache {

                 proxy_pass http://127.0.0.1:88;

                 include naproxy.conf;

        }

        access_log  /www/web_logs/www.test.com_access.log  wwwlogs;

        error_log  /www/web_logs/www.test.com_error.log;

}

 

 

其中:

ServerName www.test.com test.com m.test.com;綁定的網(wǎng)站域名(您如果有多個(gè)域名添加在這里)

index index.php; 設(shè)置默認(rèn)首頁

root /www/web/www_test_com/public_html; 是指定網(wǎng)站的目錄。

 

按“esc”退出編輯模式,輸入“:wq”保存退出。

 

4.輸入命令:nginx –s reload 重啟nginx測試。

 

5.測試網(wǎng)站。請?jiān)跒g覽器中輸入域名,測試設(shè)置。


以上內(nèi)容是否對您有幫助? 您的反饋信息提交成功,謝謝您的反饋!

會員評論

在線客服
微信咨詢
微信咨詢
現(xiàn)在咨詢,獲取演示賬號
企業(yè)logo小米
立即掃碼加我微信
電話咨詢
咨詢電話
028-61558715
預(yù)約演示
桂林市| 清镇市| 泉州市| 潮安县| 营口市| 安塞县| 河源市| 仁布县| 赣州市| 当阳市| 尼木县| 盘山县| 武安市| 济南市| 南城县| 吉林省| 乐陵市| 紫阳县| 衡山县| 宁城县| 东乡| 伊吾县| 揭东县| 繁峙县| 紫阳县| 三原县| 台前县| 石楼县| 菏泽市| 桃园市| 即墨市| 天峨县| 墨江| 乌拉特前旗| 翁源县| 报价| 法库县| 金坛市| 瓦房店市| 吴旗县| 瓮安县|