nginx 绑定域名方法很简单,只要在 nginx 中 vhost 中加入 vhost 然后把 server_name 写上你的域名就实现域名绑定了。
1、首先打开nginx域名配置文件存放目录:/usr/local/nginx/conf/vhost ,如要绑定域名 lx.vxiaoxiao.cn 则在此目录建一个文件:lx.vxiaoxiao.cn.conf 然后在此文件中写规则,如:
server
{
listen 80;
#listen [::]:80;
server_name lx.vxiaoxiao.cn;
index index.html index.php;
root /www/lx.vxiaoxiao.cn;
include none.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =