想让我的域名afacode.top默认跳转到https://blog.afacode.top

域名跳转-nginx

ubuntu 14.04

vim /etc/nginx/sites-available/default

1
2
3
4
5
6
server {
listen 80;
server_name www.afacode.top;
# 跳转地址
return 301 https://blog.afacode.top$request_uri;
}

service nginx restart

欢迎访问我的博客  地址      
https://blog.afacode.top