设为首页收藏本站

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย

返回列表 发布新帖
查看: 82|回复: 8

最近发现用户的ip不断变化,是不是与CDN有关? New

323

主题

815

回帖

1157

积分

高级会员

积分
1157
发表于 昨天 10:45 | 查看全部 |阅读模式
最近发现用户的ip不断变化,是不是与CDN有关?


我大概半个月前,1月15号,给网站添加了CDN功能。昨天突然发现admin的登录ip,一直不断变化,并且无法登录后台,


无法登录后台,可能是因为$_config['admincp']['checkip'] = 1;


然后我登录自己的小号,发现也是一样的情况,登录ip不断变化,如下图所示:


请问有没有懂CDN的大哥,就是配置了CND过后,是不是就必然导致用户的ip,不断变化呢?


有没有方法解决呢?














我知道答案 回答被采纳将会获得1 贡献 已有8人回答

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

367

主题

804

回帖

1186

积分

高级会员

积分
1186
发表于 昨天 10:46 | 查看全部
补充,我已经改过admin的密码了,登录后,也是一样的情况,ip不断变化。

367

主题

804

回帖

1186

积分

高级会员

积分
1186
发表于 昨天 10:46 | 查看全部
我问过阿里客服了,客服回复如下:
您好,阿里云CDN默认支持通过HTTP请求头 Ali-Cdn-Real-Ip 回源,您无需额外配置 。该请求头会携带客户端与CDN节点建连时的真实IP,您只需在源站读取此请求头即可获取用户真实IP,从而解决登录IP显示异常的问题 。
请问如何配置呢?我是Discuz X3.4版本,,,,,,,,,,,

323

主题

811

回帖

1155

积分

高级会员

积分
1155
发表于 昨天 10:47 | 查看全部
网站有个帖子,教你在开启CDN之后如何获取真实IP

你可以先尝试,在你的NGINX配置文件里边

在 include       mime.types; 下面添加:
  1. set_real_ip_from 0.0.0.0/0;real_ip_header Ali-CDN-Real-IP;
复制代码

不行的话,看教程
教程:
Discuz! X3.5 针对常见CDN/WAF/负载均衡,如何获取真实IP?
https://www.dismall.com/thread-15034-1-1.html
Discuz!X3.5使用CDN时,获取用户真实IP
https://www.dismall.com/thread-14651-1-1.html

323

主题

815

回帖

1157

积分

高级会员

积分
1157
 楼主| 发表于 昨天 10:48 | 查看全部
babyfacer 发表于 2026-2-7 00:56
网站有个帖子,教你在开启CDN之后如何获取真实IP

你可以先尝试,在你的NGINX配置文件里边
                谢谢大哥的回复,我根据你的建议,添加了
       

                                        set_real_ip_from 0.0.0.0/0;
       

                                        real_ip_header Ali-CDN-Real-IP;
       

                        用户ip不再变化,但是变为了ipv6地址了,如下图。
       

                        同时,我也看过你提供给我参考的另外2个帖子,他们的方法是一样的,
       

                        但是我是Discuz X3.4 20220518版本,该版本的config/config_global.php 里面,
       

                        自身并没有
       

                        // -------------------------  CONFIG IPGETTER  -------------------------- //
       

                        $_config['ipgetter']['setting'] = '';
       

                        $_config['ipgetter']['header']['header'] = 'HTTP_X_FORWARDED_FOR';
       

                        该代码,我通过手动添加该代码,并按照教程进行了修改,
       

                        多次刷新网页,依旧是老样子,Ip不断变化,也就是说,没有效果。
       

                        请求各位大哥高手,再指点一下,谢谢了
       

                                       
                           
            
        
   

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.ce-paragraph {    line-height: 1.6em;    outline: none;    text-indent: 2em;    font-size: 16px;}.ce-paragraph--right {    text-align: right;}.ce-paragraph--center {    text-align: center;}.ce-paragraph--left {    text-align: left;}.ce-paragraph--justify {    text-align: justify;}.ce-paragraph-text-indent {    text-align: justify;}.ce-paragraph[data-placeholder]:empty::before{  content: attr(data-placeholder);  color: #707684;  font-weight: normal;  opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before {  opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:focus::before {  opacity: 0;}.ce-paragraph p:first-of-type{    margin-top: 0;}.ce-paragraph p:last-of-type{    margin-bottom: 0;}.svg-icon {    width: 1em;    height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect {    fill: #4691f6;}.svg-icon circle {    stroke: #4691f6;    stroke-width: 1;}.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.image-tool {  --bg-color: #cdd1e0;  --front-color: #388ae5;  --border-color: #e8e8eb;}  .image-tool__image {    border-radius: 3px;    overflow: hidden;    margin-bottom: 10px;  }  .image-tool__image-picture {      max-width: 100%;      vertical-align: bottom;      display: block;      margin-left: auto;      margin-right: auto;    }  .image-tool__image-preloader {      width: 50px;      height: 50px;      border-radius: 50%;      background-size: cover;      margin: auto;      position: relative;      background-color: #cdd1e0;      background-position: center center;    }  .image-tool__image-preloader::after {        content: "";        position: absolute;        z-index: 3;        width: 60px;        height: 60px;        border-radius: 50%;        border: 2px solid #cdd1e0;        border-top-color: #388ae5;        left: 50%;        top: 50%;        margin-top: -30px;        margin-left: -30px;        animation: image-preloader-spin 2s infinite linear;        box-sizing: border-box;      }  .image-tool__caption[contentEditable="true"][data-placeholder]::before {      position: absolute !important;      content: attr(data-placeholder);      color: #707684;      font-weight: normal;      display: none;    }  .image-tool__caption[contentEditable="true"][data-placeholder]:empty::before {        display: block;      }  .image-tool__caption[contentEditable="true"][data-placeholder]:empty:focus::before {        display: none;      }  .image-tool--empty .image-tool__image {      display: none;    }  .image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {      display: none;    }  .image-tool .cdx-button {    display: flex;    align-items: center;    justify-content: center;  }  .image-tool .cdx-button svg {      height: auto;      margin: 0 6px 0 0;    }  .image-tool--filled .cdx-button {      display: none;    }  .image-tool--filled .image-tool__image-preloader {        display: none;      }  .image-tool--loading .image-tool__image {      min-height: 200px;      display: flex;      border: 1px solid #e8e8eb;      background-color: #fff;    }  .image-tool--loading .image-tool__image-picture {        display: none;      }  .image-tool--loading .cdx-button {      display: none;    }  /**   * Tunes   * ----------------   */  .image-tool--withBorder .image-tool__image {      border: 1px solid #e8e8eb;    }  .image-tool--withBackground .image-tool__image {      padding: 15px;      background: #cdd1e0;    }  .image-tool--withBackground .image-tool__image-picture {        max-width: 60%;        margin: 0 auto;      }  .image-tool--stretched .image-tool__image-picture {        width: 100%;      }  .image-tool__caption {                text-align: center;                font-size: 14px;                color: #a3a3a3;        }@keyframes image-preloader-spin {  0% {    transform: rotate(0deg);  }  100% {    transform: rotate(360deg);  }}.inline-code {  background: rgba(250, 239, 240, 0.78);  color: #b44437;  padding: 3px 4px;  border-radius: 5px;  margin: 0 1px;  font-family: inherit;  font-size: 0.86em;  font-weight: 500;  letter-spacing: 0.3px;}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

299

主题

794

回帖

1116

积分

高级会员

积分
1116
发表于 昨天 10:48 | 查看全部
            
            
        
   

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.image-tool {  --bg-color: #cdd1e0;  --front-color: #388ae5;  --border-color: #e8e8eb;}  .image-tool__image {    border-radius: 3px;    overflow: hidden;    margin-bottom: 10px;  }  .image-tool__image-picture {      max-width: 100%;      vertical-align: bottom;      display: block;      margin-left: auto;      margin-right: auto;    }  .image-tool__image-preloader {      width: 50px;      height: 50px;      border-radius: 50%;      background-size: cover;      margin: auto;      position: relative;      background-color: #cdd1e0;      background-position: center center;    }  .image-tool__image-preloader::after {        content: "";        position: absolute;        z-index: 3;        width: 60px;        height: 60px;        border-radius: 50%;        border: 2px solid #cdd1e0;        border-top-color: #388ae5;        left: 50%;        top: 50%;        margin-top: -30px;        margin-left: -30px;        animation: image-preloader-spin 2s infinite linear;        box-sizing: border-box;      }  .image-tool__caption[contentEditable="true"][data-placeholder]::before {      position: absolute !important;      content: attr(data-placeholder);      color: #707684;      font-weight: normal;      display: none;    }  .image-tool__caption[contentEditable="true"][data-placeholder]:empty::before {        display: block;      }  .image-tool__caption[contentEditable="true"][data-placeholder]:empty:focus::before {        display: none;      }  .image-tool--empty .image-tool__image {      display: none;    }  .image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {      display: none;    }  .image-tool .cdx-button {    display: flex;    align-items: center;    justify-content: center;  }  .image-tool .cdx-button svg {      height: auto;      margin: 0 6px 0 0;    }  .image-tool--filled .cdx-button {      display: none;    }  .image-tool--filled .image-tool__image-preloader {        display: none;      }  .image-tool--loading .image-tool__image {      min-height: 200px;      display: flex;      border: 1px solid #e8e8eb;      background-color: #fff;    }  .image-tool--loading .image-tool__image-picture {        display: none;      }  .image-tool--loading .cdx-button {      display: none;    }  /**   * Tunes   * ----------------   */  .image-tool--withBorder .image-tool__image {      border: 1px solid #e8e8eb;    }  .image-tool--withBackground .image-tool__image {      padding: 15px;      background: #cdd1e0;    }  .image-tool--withBackground .image-tool__image-picture {        max-width: 60%;        margin: 0 auto;      }  .image-tool--stretched .image-tool__image-picture {        width: 100%;      }  .image-tool__caption {                text-align: center;                font-size: 14px;                color: #a3a3a3;        }@keyframes image-preloader-spin {  0% {    transform: rotate(0deg);  }  100% {    transform: rotate(360deg);  }}.inline-code {  background: rgba(250, 239, 240, 0.78);  color: #b44437;  padding: 3px 4px;  border-radius: 5px;  margin: 0 1px;  font-family: inherit;  font-size: 0.86em;  font-weight: 500;  letter-spacing: 0.3px;}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

345

主题

834

回帖

1204

积分

高级会员

积分
1204
发表于 昨天 10:49 | 查看全部
整个是正常的;

阿里云cdn 应该是 支持ipv6的, 然后 你电脑也支持ipv6, 然后就优先走 ipv6了


你可以去阿里云那边问问 看 是否能 禁止对ipv6的支持

335

主题

793

回帖

1145

积分

高级会员

积分
1145
发表于 昨天 10:49 | 查看全部
如果你已经获取到真实IP了,还折腾干嘛???你看清楚那个教程,config文件,不是优先要改的

298

主题

814

回帖

1127

积分

高级会员

积分
1127
发表于 昨天 10:50 | 查看全部
需要修改阿里云cdn与网站之间的配置。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

投诉/建议联系

点我~

未经授权禁止转载,复制和建立镜像,
如有违反,追究法律责任
  • 应用中心
  • 建议反馈
Copyright © 2001-2026 DiscuzQ源码网. 版权所有 All Rights Reserved.   |网站地图
关灯 在本版发帖
扫一扫反馈建议
返回顶部
快速回复 返回顶部 返回列表