VPS侦探论坛

 找回密码
 注册
查看: 4350|回复: 11

只能访问探针 nginx重启和日志报错 有大佬知道怎么改吗

[复制链接]
发表于 2020-1-30 02:10:45 | 显示全部楼层 |阅读模式

只能访问探针 nginx重启和日志报错 有大佬知道怎么改吗


nginx... nginx: [warn] conflicting server name "192.168.1.197" on 0.0.0.0:80, ignored
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2020-1-30 10:43:39 | 显示全部楼层


server name 那里你看下,是不是定义重复了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2020-1-30 10:53:13 | 显示全部楼层

nginx提示“nginx: [warn] conflicting server name "192.168.1.197" on 0.0.0.0:80, ignored”,说明你在多个虚拟主机里面设置了多个相同的192.168.1.197的server_name造成了冲突

不清楚你说的“只能访问探针”,需要具体描述问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-1-30 15:54:21 | 显示全部楼层



licess 发表于 2020-1-30 10:53
nginx提示“nginx: [warn] conflicting server name "192.168.1.197" on 0.0.0.0:80, ignored”,说明你在 ...

就是只能访问自带的php探针  我要在局域网内访问sever name 必须一样才能访问把
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-1-30 15:55:12 | 显示全部楼层

txf861 发表于 2020-1-30 10:43
server name 那里你看下,是不是定义重复了

我要在局域网内访问 这个必须一样吧

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

 楼主| 发表于 2020-1-30 16:35:57 | 显示全部楼层

licess 发表于 2020-1-30 10:53
nginx提示“nginx: [warn] conflicting server name "192.168.1.197" on 0.0.0.0:80, ignored”,说明你在 ...

改sever name后不报错 但是不能访问网站 只能访问php探针
发表于 2020-1-30 19:07:19 | 显示全部楼层

gudumibug 发表于 2020-1-30 16:35
改sever name后不报错 但是不能访问网站 只能访问php探针

不清楚你居然配置文件和机器情况没法说

nginx虽然可以用ip作为server_name,但是server_name必须是唯一的,多个就会报前面的warning信息
用IP访问,只要有这个IP的server_name就肯定到这个server_name的虚拟主机上,访问到的时探针就说明你访问到了默认虚拟主机上,肯定也就是配置文件有问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-1-31 07:35:37 | 显示全部楼层

licess 发表于 2020-1-30 19:07
不清楚你居然配置文件和机器情况没法说

nginx虽然可以用ip作为server_name,但是server_name必须是唯一 ...

大佬需要我提供什么信息 用的armbian装的  原来好好的 出门貌似他自动更新还是怎么了 就不能用了 配置文件具体要看那个
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2020-2-1 08:51:22 | 显示全部楼层


gudumibug 发表于 2020-1-31 07:35
大佬需要我提供什么信息 用的armbian装的  原来好好的 出门貌似他自动更新还是怎么了 就不能用了 配置文 ...

改动的哪个或添加的哪个就发哪个的

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

 楼主| 发表于 2020-2-4 03:33:02 | 显示全部楼层



licess 发表于 2020-2-1 08:51
改动的哪个或添加的哪个就发哪个的

那个都没有改动
 楼主| 发表于 2020-2-4 04:22:27 | 显示全部楼层

licess 发表于 2020-2-1 08:51
改动的哪个或添加的哪个就发哪个的

server
    {
        listen 82;
        #listen [::]:82;
        server_name 192.168.1.197;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/192.168.1.121;

        include rewrite/none.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php-pathinfo.conf;

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

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

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/192.168.1.121.log;
    }

就是这样的
发表于 2020-2-4 19:06:28 | 显示全部楼层

gudumibug 发表于 2020-2-4 04:22
server
    {
        listen 82;

单纯这个配置文件上没错误
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-8 09:24 , Processed in 0.037046 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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