账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    阿里云ECS同一服务器下的不同域名ping出了不同的IP?
    10
    0

    我在阿里云ECS服务器上配置https多站点的时候,遇到了这样的问题:
    这是nginx的配置文件:

    server {
            listen       443 ssl;
            server_name  domain1;
            ssl on;
            root /usr/local/nginx/html;
            ssl_certificate      cert/domain1.pem;
            ssl_certificate_key  cert/domain1.key;
            index index.php index.html index.htm
            ssl_session_timeout  5m;
            ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_prefer_server_ciphers  on;
    
             location ~ \.php {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                index index.php index.html index.htm;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/$fastcgi_script_name;
                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                include fastcgi_params;
           }
    
    
        }
        server {
            listen 443;
            server_name domain2;
            ssl on;
            ssl_certificate     cert/1_domain2_bundle.crt;
            ssl_certificate_key cert/2_domain2.key;
            ssl_session_timeout 5m;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
            ssl_prefer_server_ciphers on;
             location ~ \.php {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/dzt666/phphelper/public/$fastcgi_script_name;
                root   /usr/local/nginx/html/dzt666/phphelper/public;
                index  index.php index.html index.htm;
            }
        }
    server {
            listen 443;
            server_name domain3;
            root   /usr/local/nginx/html/dzt666/lostandfound/public/;
            index  index.php index.html index.htm;
            ssl on;
            ssl_certificate     cert/1_domain3_bundle.crt;
            ssl_certificate_key cert/2_domain3.key;
            ssl_session_timeout 5m;
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
            ssl_prefer_server_ciphers on;
            location ~ \.php {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html/dzt666/lostandfound/public/$fastcgi_script_name;
                #root   /usr/local/nginx/html/dzt666/lostandfound/public/;
                #index  index.php index.html index.htm;
            }
        }
    

    这是在终端ping出的结果:

    [root@localhost ~]# ping domain1
    PING domain1.w.kunlungr.com (123.12.123.188) 56(84) bytes of data.
    64 bytes from 123.12.123.188.broad.km.yn.dynamic.163data.com.cn (123.12.123.188): icmp_seq=1 ttl=48 time=11.5 ms
    ^C
    --- domain1.w.kunlungr.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 11.512/11.512/11.512/0.000 ms
    [root@localhost ~]# ping domain2
    PING domain2.w.kunlunar.com (123.12.123.188) 56(84) bytes of data.
    64 bytes from 188.241.55.116.broad.km.yn.dynamic.163data.com.cn (123.12.123.188): icmp_seq=1 ttl=48 time=12.3 ms
    ^C
    --- domain2.w.kunlunar.com ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 12.304/12.304/12.304/0.000 ms
    [root@localhost ~]# ping domain3
    PING domain3.w.kunlungr.com (123.12.123.183) 56(84) bytes of data.
    64 bytes from 183.241.55.116.broad.km.yn.dynamic.163data.com.cn (123.12.123.183): icmp_seq=1 ttl=48 time=6.94 ms
    64 bytes from 183.241.55.116.broad.km.yn.dynamic.163data.com.cn (123.12.123.183): icmp_seq=2 ttl=48 time=8.34 ms
    ^C
    --- domain3.w.kunlungr.com ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 1000ms
    rtt min/avg/max/mdev = 6.943/7.643/8.343/0.700 ms
    [root@localhost ~]# 
    

    domain1能正常访问,domain3不能正常访问,请教各位前辈,我的配置哪里出了问题,该怎么来处理这类的问题?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 独自上岸自我救赎 普通会员 1楼

      阿里云ECS中,同一服务器下的不同域名ping出了不同的IP,可能有以下几种情况:

      1. 网络环境问题:可能因为网络环境的问题导致不同域名无法ping出同一IP地址,比如DNS解析的问题、防火墙设置问题等。

      2. DNS缓存问题:DNS缓存可能会导致不同域名ping出同一IP地址,比如DNS缓存中的某个域名出现问题,导致解析失败,从而ping出了不同的IP地址。

      3. 服务器负载问题:如果服务器负载过高,可能会导致不同域名ping出同一IP地址,比如CPU、内存等资源使用过高,导致响应速度变慢。

      4. 异常问题:如果服务器出现异常,可能会导致不同域名ping出同一IP地址,比如服务器宕机、网络故障等。

      解决这些问题的方法包括:

      1. 检查网络环境,确保DNS解析正常,防火墙设置正常。

      2. 清理DNS缓存,或者更新DNS缓存。

      3. 优化服务器配置,比如增加CPU、内存等资源。

      4. 如果服务器出现异常,需要及时处理,避免异常影响其他域名的ping请求。

    更多回答
    扫一扫访问手机版