日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Nginx配置二級域名
當(dāng)一個域名需要使用在兩個項目上后,我們就需要使用到二級域名,在 Nginx 中配置二級域名如下:
1、原始配置文件如下
worker_processes? 1;




events {

? ? worker_connections? 1024;

}




http {

? ? include? ? ? ?mime.types;

? ? default_type? application/octet-stream;




? ? sendfile? ? ? ? on;




? ? keepalive_timeout? 65;




? ? server {

? ? ? ? listen? ? ? ?80;

? ? ? ? server_name? localhost;




? ? ? ? location / {

? ? ? ? ? ? root? ?html;

? ? ? ? ? ? index? index.html index.htm;

? ? ? ? }




? ? ? ? error_page? ?500 502 503 504? /50x.html;

? ? ? ? location = /50x.html {

? ? ? ? ? ? root? ?html;

? ? ? ? }

? ? }




}
這是解壓后的 nginx.conf 文件,可以看出,當(dāng)前 nginx 監(jiān)聽的是 80 端口,它的服務(wù)名為 localhost,假如我們的域名為:baidu.com,那我們輸入:localhost.baidu.com 也是可以訪問的
2、配置二級域名
對于我們剛才理解的服務(wù)名,假如我們的域名為:baidu.com,我們需要配置的二級域名為 asurplus.baidu.com,我們的配置文件如下
worker_processes? 1;




events {

? ? worker_connections? 1024;

}




http {

? ? include? ? ? ?mime.types;

? ? default_type? application/octet-stream;




? ? sendfile? ? ? ? on;




? ? keepalive_timeout? 65;




? ? server {

? ? ? ? listen? ? ? ?80;

? ? ? ? server_name? localhost;




? ? ? ? location / {

? ? ? ? ? ? root? ?html;

? ? ? ? ? ? index? index.html index.htm;

? ? ? ? }




? ? ? ? error_page? ?500 502 503 504? /50x.html;

? ? ? ? location = /50x.html {

? ? ? ? ? ? root? ?html;

? ? ? ? }

? ? }




server {

? ? ? ? listen? ? ? ?80;

? ? ? ? server_name? asurplus.baidu.com;




? ? ? ? location / {

proxy_pass http://127.0.0.1:8081;

? ? ? ? }

? ? }




}
到 sbin 目錄,執(zhí)行命令重啟 nginx
./nginx -s reload
1
我們新增了一個服務(wù),監(jiān)聽的依然是 80 端口,我們的服務(wù)名變成了我們的二級域名:asurplus,并轉(zhuǎn)發(fā)到了我們的 8081 端口,從而完成了二級域名的配置

名稱欄目:Nginx配置二級域名
標(biāo)題URL:http://m.5511xx.com/article/dhopphd.html