Skip to content

子域名配置

域名管理处的配置

我是把在namesilo处买的域名,然后把NameServers指向了 f1g1ns1.dnspod.net f1g1ns2.dnspod.net。然后在dnspod 添加了*domain.com 泛域名解析,然后要等一会儿,毕竟namesilo是国外的域名商,我开始以为没有作用,然后反复试各种方法,浪费了很多时间。

nginx 的配置

server{
    listen 80;
    server_name  riyue.me;
    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }
    root   /var/www/riyue;
    index  index.php index.html index.htm;
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
    }
}

server{
    listen 80;
    server_name  blog.riyue.me;
    # if ($scheme != "https") {
    #     return 301 https://$host$request_uri;
    # }
    root   /var/www/blog/public;
    index  index.php index.html index.htm;
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
    }
}

重启nginx

nginx -s reload