使用Nginx实现二级域名

使用Nginx实现二级域名

二级域名可以充分利用起自己的域名资源

配置nginx.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
vim /etc/nginx/sites-available/defalut

server {
listen 80;
listen [::]:80;

server_name blog.qshijun.club;

root /var/www/example.com;
index index.html index.htm;

location / {
#try_files $uri $uri/ =404;
proxy_pass https://qiushijun.github.io;
}
}