Ip_60_secs_limit 我开启了那个CF还是提示

提示服务器 IP 地址访问限制错误。

Slow down, too many requests from this IP address.
Please retry again in 15 seconds.
Error code: ip_60_secs_limit.

你看看用户的IP地址显示正常不?

:rofl:这里有一个答案是组件调用太多了。

我使用了官方的那个yml现在登录


都提示的我服务器的IP地址就离谱了

头大怎么解决啊

你这是没配置成功吧,我也这么配的。

image

不过我的论坛没啥人验证不了,但是MaxMindDB配置了它显示ip是正确的。

如果是CF的地址应该是美国的。

Using Discourse with Cloudflare: Best Practices - Documentation / Self-Hosting - Discourse Meta

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/cloudflare.template.yml"
  ## 取消注释下一行以启用IPv6监听器
  #- "templates/web.ipv6.template.yml"
  - "templates/web.ratelimited.template.yml"
  ## 如果希望添加Lets Encrypt (https),取消注释以下两行
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"

## 这个容器应该暴露哪些TCP/IP端口?
## 如果您希望Discourse与另一个Web服务器(如Apache或nginx)共享端口,
## 详情请参见 https://meta.discourse.org/t/17247
expose:
  - "50080:80"   # http
  - "50443:443"  # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## 将db_shared_buffers设置为总内存的最大25%。
  ## 将由引导程序根据检测到的RAM自动设置,或者您可以覆盖
  db_shared_buffers: "8192MB"

  ## 可以提高排序性能,但会增加每个连接的内存使用
  db_work_mem: "256MB"

我还按照了官方说的优化了CF的设置表示我也不是很懂啊

那你看看这个?

IP 地址查询了下。

这个地址应该不是 CF 的地址,是你真实用户的地址。

如果是这样的话,那么配置应该是成功的。

那这样,你让你的网站访问跳过 CF。

把 CF 的代理那个功能从 CF 中关掉,那么所有访问不管用没有用 CF 的服务,都会直接显示为地址。

这个时候你再去试试网站有没有超时问题。

如果有超时问题,那么就是你 Discourse 安装实例上面的问题了,就可以排除是 CF 的问题。

如果这个时候,也设置 ip_60_secs_limit 的值为比较大的值的话,那么可能是购买的虚拟服务上面针对网络的配置有没有正确发送 IP 地址。

可以通过 Discourse 内部的 Nginx 访问日志看到的。

那个是我服务器的IP地址所有人都是使用我的服务器真实的IP地址了。

OK,如果是这样的话,还有超时问题吗?

如果有超时问题,那看看是不是 Discourse 实例配置的情况。

把 Nginx 的日志拿出看一下。

看一下上面的记录是什么。

这种情况就是有问题了吧,和之前没配置CF的yml一样,所有人使用CF的代理地址。
那就是你服务器的代理有问题?

server {
    listen 80 ; 
    listen 443 ssl http2 ; 
    server_name www.justnainai.com; 
    index index.php index.html index.htm default.php default.htm default.html; 
    proxy_set_header Host $host; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Host $server_name; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_http_version 1.1; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection $http_connection; 
    access_log /www/sites/www.justnainai.com/log/access.log main; 
    error_log /www/sites/www.justnainai.com/log/error.log; 
    location ^~ /.well-known/acme-challenge {
        allow all; 
        root /usr/share/nginx/html; 
    }
    include /www/sites/www.justnainai.com/proxy/*.conf; 
    if ($scheme = http) {
        return 301 https://$host$request_uri; 
    }
    ssl_certificate /www/sites/www.justnainai.com/ssl/fullchain.pem; 
    ssl_certificate_key /www/sites/www.justnainai.com/ssl/privkey.pem; 
    ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1 TLSv1; 
    ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK:!KRB5:!SRP:!CAMELLIA:!SEED; 
    ssl_prefer_server_ciphers on; 
    ssl_session_cache shared:SSL:10m; 
    ssl_session_timeout 10m; 
    error_page 497 https://$host$request_uri; 
    proxy_set_header X-Forwarded-Proto https; 
    add_header Strict-Transport-Security "max-age=31536000"; 
}
2024/12/03 18:44:37 [error] 892#892: *6468447 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.114.36, server: www.justnainai.com, request: "POST /message-bus/10b50a006f8047e8bf39fce4c649dd3a/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/10b50a006f8047e8bf39fce4c649dd3a/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/"2024/12/03 18:44:42 [error] 892#892: *6468657 connect() failed (111: Connection refused) while connecting to upstream, client: 172.71.223.216, server: www.justnainai.com, request: "GET /t/topic/11008 HTTP/2.0", upstream: "http://188.253.7.191:50080/t/topic/11008", host: "www.justnainai.com"2024/12/03 18:44:44 [error] 892#892: *6467687 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.41.239, server: www.justnainai.com, request: "POST /message-bus/94534c6d21c14ab1822c3326e9942061/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/94534c6d21c14ab1822c3326e9942061/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/34840"2024/12/03 18:44:48 [error] 892#892: *6468233 connect() failed (111: Connection refused) while connecting to upstream, client: 172.70.42.148, server: www.justnainai.com, request: "POST /message-bus/42a216086a33438c999383271631771c/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/42a216086a33438c999383271631771c/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/categories"2024/12/03 18:44:48 [error] 892#892: *6468318 connect() failed (111: Connection refused) while connecting to upstream, client: 172.70.42.166, server: www.justnainai.com, request: "POST /message-bus/94fbd071b1f444f59677176bd7c0000d/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/94fbd071b1f444f59677176bd7c0000d/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/35632"2024/12/03 18:44:55 [error] 892#892: *6467908 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/813dab176f9545e38daa228e32a093cd/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/813dab176f9545e38daa228e32a093cd/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/28400"2024/12/03 18:44:55 [error] 892#892: *6467908 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/402ecf98173f432881e1ae19b2dd0726/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/402ecf98173f432881e1ae19b2dd0726/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/16870"2024/12/03 18:44:57 [error] 892#892: *6468675 connect() failed (111: Connection refused) while connecting to upstream, client: 172.70.43.27, server: www.justnainai.com, request: "GET /tag/%E5%8A%A8%E6%BC%AB HTTP/2.0", upstream: "http://188.253.7.191:50080/tag/%E5%8A%A8%E6%BC%AB", host: "www.justnainai.com"2024/12/03 18:45:00 [error] 892#892: *6467906 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.70, server: www.justnainai.com, request: "POST /message-bus/0d8cf28382c54d909d6cfbcf8febff75/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/0d8cf28382c54d909d6cfbcf8febff75/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5"2024/12/03 18:45:02 [error] 892#892: *6467907 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/4cb26b48ceaf41c398dc90e6273707f1/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/4cb26b48ceaf41c398dc90e6273707f1/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/30639"2024/12/03 18:45:02 [error] 892#892: *6467907 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/2c00ba62085e40d290cf2c5e33dd7a08/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/2c00ba62085e40d290cf2c5e33dd7a08/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/35632"2024/12/03 18:45:02 [error] 892#892: *6467907 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/1fd7d529c3494124bee7407d55ecd33a/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/1fd7d529c3494124bee7407d55ecd33a/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/19596"2024/12/03 18:45:02 [error] 892#892: *6467907 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/52e888fdc2c44aefb7fbfc43d527cf7c/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/52e888fdc2c44aefb7fbfc43d527cf7c/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/search?q=%E5%A5%B3%E5%B0%8F%E5%81%B7"2024/12/03 18:45:03 [error] 892#892: *6468447 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.114.36, server: www.justnainai.com, request: "POST /message-bus/f6913ab29b764cc0855cb3e8d0bba488/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/f6913ab29b764cc0855cb3e8d0bba488/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5"2024/12/03 18:45:03 [error] 892#892: *6468685 connect() failed (111: Connection refused) while connecting to upstream, client: 172.71.211.60, server: www.justnainai.com, request: "POST /message-bus/66f8cf587f074469878914b564e939f4/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/66f8cf587f074469878914b564e939f4/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/tag/3d"2024/12/03 18:45:05 [error] 892#892: *6467908 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.69, server: www.justnainai.com, request: "POST /message-bus/3970baa51ab741c9bc56c974ffe43739/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/3970baa51ab741c9bc56c974ffe43739/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/1378"2024/12/03 18:45:07 [error] 892#892: *6467906 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.246.70, server: www.justnainai.com, request: "POST /message-bus/4a7ba7867b1444d59f8c67c92cf5dfe6/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/4a7ba7867b1444d59f8c67c92cf5dfe6/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/top?period=weekly"2024/12/03 18:45:14 [error] 892#892: *6467687 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.41.239, server: www.justnainai.com, request: "POST /message-bus/9ba4b1fdefcf4a159bd1a321680df497/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/9ba4b1fdefcf4a159bd1a321680df497/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/35163"2024/12/03 18:45:14 [error] 892#892: *6468691 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.62.183, server: www.justnainai.com, request: "POST /message-bus/1a20d842ee344b769f35e287cbcc4658/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/1a20d842ee344b769f35e287cbcc4658/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/t/topic/35709"2024/12/03 18:45:16 [error] 892#892: *6468696 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.170.56, server: www.justnainai.com, request: "GET /c/5-category/5/l/latest?order=created HTTP/2.0", upstream: "http://188.253.7.191:50080/c/5-category/5/l/latest?order=created", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5/l/latest?order=created"2024/12/03 18:45:17 [error] 892#892: *6468698 connect() failed (111: Connection refused) while connecting to upstream, client: 162.158.170.26, server: www.justnainai.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://188.253.7.191:50080/favicon.ico", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5/l/latest?order=created"2024/12/03 18:45:17 [error] 892#892: *6468700 connect() failed (111: Connection refused) while connecting to upstream, client: 172.71.210.226, server: www.justnainai.com, request: "POST /message-bus/10b50a006f8047e8bf39fce4c649dd3a/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/10b50a006f8047e8bf39fce4c649dd3a/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/"2024/12/03 18:45:17 [error] 892#892: *6468691 connect() failed (111: Connection refused) while connecting to upstream, client: 172.68.62.183, server: www.justnainai.com, request: "POST /message-bus/8b11aca8a6e946bdbb608fafa3dc6acd/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/8b11aca8a6e946bdbb608fafa3dc6acd/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5"2024/12/03 18:45:18 [error] 892#892: *6468703 connect() failed (111: Connection refused) while connecting to upstream, client: 172.71.150.250, server: www.justnainai.com, request: "POST /message-bus/2be1051fe9704006ab7bc241dbd3967a/poll?dlp=t HTTP/2.0", upstream: "http://188.253.7.191:50080/message-bus/2be1051fe9704006ab7bc241dbd3967a/poll?dlp=t", host: "www.justnainai.com", referrer: "https://www.justnainai.com/tag/rpg"2024/12/03 18:45:19 [error] 892#892: *6468706 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.226.207, server: www.justnainai.com, request: "GET /c/5-category/5/l/latest?order=created HTTP/2.0", upstream: "http://188.253.7.191:50080/c/5-category/5/l/latest?order=created", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5/l/latest?order=created"2024/12/03 18:45:19 [error] 892#892: *6468708 connect() failed (111: Connection refused) while connecting to upstream, client: 108.162.226.223, server: www.justnainai.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://188.253.7.191:50080/favicon.ico", host: "www.justnainai.com", referrer: "https://www.justnainai.com/c/5-category/5/l/latest?order=created"
网站日志
错误日志
Copyright © 2014-2024 飞致云
论坛求助
使用手册
项目地址
社区版:
v1.10.21-

希望可以帮我看看

error (2).txt (2.2 MB)

你的配置是不是少了一个 proxy_pass http://127.0.0.1:8080(设置反向代理的目标地址)

补充GPT的回答:

应该就是找不到端口

看了日志。

上面请求的 IP 地址,172 开头的地址多是 CloudFlare 的地址,你的 Discourse 安装实例给的访问拒绝。

路径应该是你的网站域名,收到访问请求后,把请求转发给 http://188.253.7.191:50080 这个地址,并且端口是 50080。

需要注意的是,这个请求是用的 http,不是 https

Discourse 对 SSL 的要求转发比较严格。

这里有 2 个问题:

  • 服务器收到的地址还是 CF 的地址,不是用户的真实地址。
  • Discourse 走的是 http 协议,没有走 https

ping 下我们网站,你应该能看到 CF 给的地址。

因此,针对你的问题,看起来更像是配置上面的问题。

1 Like

我用的是1panle的 应用商店里面的

OpenResty基于 NGINX 和 LuaJIT 的 Web 平台

他里面的反向代理但是他有2个

配置文件一个是网址的一个是反向代理的

我也不知道这样设置是不是对的反正现在还是在报错

网站配置文件 【2】

server {
    listen 80 ; 
    listen 443 ssl http2 ; 
    server_name www.justnainai.com; 
    index index.php index.html index.htm default.php default.htm default.html; 
    # Cloudflare 反向代理头部设置
    proxy_set_header Host $host; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Host $server_name; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-Proto $scheme; # 确保HTTPS代理头传递正确
    proxy_set_header CF-Connecting-IP $remote_addr; # 使用 Cloudflare 的真实客户端 IP
    # 保证连接保持一致性
    proxy_http_version 1.1; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection $http_connection; 
    # 日志设置
    access_log off; 
    error_log /www/sites/www.justnainai.com/log/error.log; 
    # 证书认证相关
    ssl_certificate /www/sites/www.justnainai.com/ssl/fullchain.pem; 
    ssl_certificate_key /www/sites/www.justnainai.com/ssl/privkey.pem; 
    ssl_protocols TLSv1.3 TLSv1.2; # 只使用安全的 SSL 协议版本
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256'; 
    ssl_prefer_server_ciphers on; 
    ssl_session_cache shared:SSL:10m; 
    ssl_session_timeout 10m; 
    # 安全设置
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"; # 强制使用 HTTPS
    # 防止直接访问 .well-known/acme-challenge
    location ^~ /.well-known/acme-challenge {
        allow all; 
        root /usr/share/nginx/html; 
    }
    # 强制 HTTPS 重定向
    if ($scheme = http) {
        return 301 https://$host$request_uri; 
    }
    # 错误页面处理
    error_page 497 https://$host$request_uri; 
    # 反向代理配置
    include /www/sites/www.justnainai.com/proxy/*.conf; 
}

反向代理源码[1]

location ^~ / {
    proxy_pass http://188.253.7.191:50080;  # 将请求转发到指定 IP 和端口
    proxy_set_header Host $host;  # 保持请求的 Host 头部
    proxy_set_header X-Real-IP $remote_addr;  # 传递客户端的真实 IP 地址
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  # 保持转发链
    proxy_set_header REMOTE-HOST $remote_addr;  # 传递客户端的真实 IP 地址
    proxy_set_header Upgrade $http_upgrade;  # 升级 WebSocket 连接时需要的设置
    proxy_set_header Connection $http_connection;  # 保持连接头部
    proxy_set_header X-Forwarded-Proto $scheme;  # 转发协议(http 或 https)
    proxy_http_version 1.1;  # 使用 HTTP/1.1 版本,确保兼容性
    add_header X-Cache $upstream_cache_status;  # 添加缓存状态头部
    add_header Cache-Control no-cache;  # 禁用缓存
    proxy_ssl_server_name on;  # 确保服务器名称在 SSL 握手中正确
    proxy_ssl_name $proxy_host;  # 确保 SSL 请求头包含正确的主机名
    add_header Strict-Transport-Security "max-age=31536000";  # 强制浏览器使用 HTTPS
}

有点头疼完全不会写这个配置。

并且用IP地址可以访问我的网站这正常嘛。

IP 地址可以改成 Localhost 吗,如果在通一个机器上的话。

他们这个配置初步看起来是没有什么太大的问题的。

服务器同时监听了80 和 443 端口。

我发现你的网站有一个问题,你网站会有 https 的问题,如果是直接 IP 访问,上面的内容会条状到 http,哪怕是 IP 访问这部分的内容应该是 https 的。

等于跳转了一圈回来,还有部分内容没有 HTTPS。

如果直接用域名,好一点,但还是有内容没有在 https 下面。

访问了下你的网站,没有发现有什么问题。

感觉也都还蛮正常的。

没有遇到 60 秒的问题。

因为是设置了同一个IP可以支持 9999 人的登录但是晚上的时候就开始不行了。

人多起来了。

我现在还不知道是什么原因导致登录的人都是同一个IP地址

他们都是我服务器的IP地址我现在不知道如何解决