VPS侦探论坛

 找回密码
 注册
查看: 6206|回复: 7

添加虚拟主机后访问不了域名

[复制链接]
发表于 2013-11-25 14:57:21 | 显示全部楼层 |阅读模式

我添加的是www.baidu.com访问后还是跳转到百度上面去了。
/usr/local/nginx/sbin/nginx -t 的返回信息如下:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

求解啊军哥哥,搞了好几天,不管绑定什么域名都不可以
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-11-25 15:39:49 | 显示全部楼层

/usr/local/nginx/sbin/nginx -t 的返回信息如下



nginx: [warn] conflicting server name "www.baidu.com" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "baidu.org" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.lishuangchao.com" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "lsc.com" on 0.0.0.0:80, ignored
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
***********************************************************************************************
nginx.conf信息如下:
server
    {
        listen       80;
        server_name www.lnmp.org;
        index index.html index.htm index.php;
        root  /home/wwwroot/default;

        location ~ .*\.(php|php5)?$
            {
                try_files $uri =404;
                fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_index index.php;
                include fcgi.conf;
            }

        location /status {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }

        location ~ .*\.(js|css)?$
            {
                expires      12h;
            }

        access_log  /home/wwwlogs/access.log  access;
    }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
www.baidu.com.conf信息如下
server
    {
        listen       80 default;
        server_name www.baidu.com baidu.org www.lishuangchao.com lsc.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot;

        include wordpress.conf;
        location ~ .*\.(php|php5)?$
            {
                #try_files $uri =404;
                fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_index index.php;
                include fcgi.conf;
            }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }

        location ~ .*\.(js|css)?$
            {
                expires      12h;
            }

        access_log off;
    }
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-11-25 16:38:27 | 显示全部楼层

错误提示中的域名添加了多次

不是你的域名,没解析到你vps IP上的话肯定访问的不是你的网站
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-11-25 16:48:40 | 显示全部楼层

回复 2# 的帖子




如何把任意一个域名解析到自己的vps IP上
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-11-25 18:38:06 | 显示全部楼层

回复 3# 的帖子


军哥哥如何将任意一个域名解析到自己的vps IP上啊

军哥运维代购:http://shop63846532.taobao.com/

发表于 2013-11-25 19:44:24 | 显示全部楼层

别人的域名没法解析到你的ip上

当然可以改hosts,win系统上位置在 %SystemRoot%\System32\drivers\etc\hosts
添加如下内容:

你vps的ip www.baidu.com

不过这种属于自己骗自己,只能本机凑效。
 楼主| 发表于 2013-11-25 20:22:02 | 显示全部楼层

回复 6# 的帖子


噢噢,原来是这样啊,那么这种操作在linux下也是可以修改的
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-11-26 20:20:06 | 显示全部楼层

回复 7# 的帖子


linux一般是/etc/hosts 这里
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 05:33 , Processed in 0.039113 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表