阿里云Linux主机绑定域名_nginx绑定域名

此次分享的是 阿里云Linux主机绑定域名_nginx绑定域名

下面的具体的步骤:

1、新建 conf 配置文件

在 /alidata/server/nginx-1.4.4/conf/vhosts 中 新建一个 conf文件

比如微夏博客想要添加一个子域名为 abc.vxia.net

则在文件夹中创建一个 abc.vxia.net.conf 文件

2、输入配置源代码

 

server {
    listen 80;
    server_name abc.vxia.net;
 
    root /alidata/www/abc;
    index index.html index.htm index.php;
 
    location / {
        try_files $uri $uri/ /index.php;
    }
 
    location ~ .php$ {
        try_files $uri =404;
 
        include fastcgi.conf;
        fastcgi_pass 127.0.0.1:9000;
    }
}

3、添加域名解析

在自己的域名管理平台,添加相应的解析地址

4、重启nginx服务,使之生效

Linux连接后,输入重启nginx服务命令,使之生效。

service nginx reload

转载请注明出处:https://stgod.com/1572/

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: