利用nginx泛網域名稱解析配置二級網域名稱和多網域名稱

2021-09-22 13:11:48 字數 875 閱讀 5484

利用nginx泛網域名稱解析配置二級網域名稱和多網域名稱

**的目錄結構為 html ├── bbs └── www

html為nginx的安裝目錄下預設的存放源**的路徑。

bbs為論壇程式源**路徑 www為主頁程式源**路徑

把相應程式放入上面的路徑通過 訪問的就是主頁 訪問的就是論壇 其它二級網域名稱類推。

server 

# redirect server error pages to the static page /50x.html

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

location = /50x.html 

# pass the php scripts to fastcgi server listening on 127.0.0.1:9000

#location ~ .php$ 

# deny access to .htaccess files, if apache's document root

# concurs with nginx's one

#location ~ /.ht 

}

總結一下步驟就是

1.把上面的紅色配置換成你的網域名稱後新增到你的nginx.conf配置檔案

2.確認要增加的二級網域名稱,如bbs.yourdomain.com

3.設定bbs.yourdomain.com解析到你的nginx伺服器ip

4.在html目錄下建立bbs目錄

5.把原始碼放入bbs目錄

kill -hup `cat /usr/local/lnmp/nginx/nginx.conf`

(需要把上面命令的路徑換成你的配置檔案路徑)

7.訪問

泛網域名稱解析

什麼是泛網域名稱解析,泛網域名稱解析又該怎樣做?下面將介紹幾種方法 什麼是泛網域名稱解析 泛網域名稱解析是指將 網域名稱 解析到同一ip。在網域名稱前新增任何子網域名稱 均可訪問到所指向的web位址。也就是客戶的網域名稱a.com之下所設的 a.com全部解析到同乙個ip位址上去。比如客戶設b.a....

Nginx泛網域名稱解析設定 時間

泛網域名稱解析 server name www.002pc.com 002pc.com server name in redirect off 設定預設root set rootdir usr local nginx html 002pc 匹配 網域名稱 if host 匹配二級網域名稱 if ho...

Apache泛網域名稱解析

documentroot e work phpstudy www ncpx web servername ncpxceshi2.com 主機名 serveralias ncpxceshi2.com 範解析 options followsymlinks execcgi allowoverride al...