1.將域名添加到域名解析器html
主機記錄填二級域名,記錄值填ip,不用跟端口nginx
2.修改配置文件vim
vim nginx的default.conf網站
在conf後面再加一個server搜索引擎
server {
listen 80; #監聽端口
server_name go.域名.cn; #網站域名
location / {
root /mnt/company/go/weiqi; #網站根目錄
index index.html index.htm; #默認文件
}rest
#添加錯誤頁面,利於搜索引擎收錄以及良好的用戶體驗server
error_page 404 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}htm
}blog
3.重啓nginx便可,service nginx restart索引