1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

交流 Xenforo 设置获取阿里云云盾前端真实IP

本帖由 woi9112015-10-18 发布。版面名称:XenForo中文版

  1. woi911

    woi911 VIP会员

    注册:
    2014-02-19
    帖子:
    283
    赞:
    59
    [root@SERVER sbin]# nginx -V
    nginx version: nginx
    configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_spdy_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-ld-opt='-ljemalloc'


    [root@SERVER sbin]#vi nginx.conf

    user www www;
    worker_processes auto;

    error_log /home/wwwlogs/error_nginx.log crit;
    pid /var/run/nginx.pid;
    worker_rlimit_nofile 51200;

    events {
    use epoll;
    worker_connections 51200;
    }

    http {
    include blockip.conf;
    include mime.types;
    default_type application/octet-stream;
    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 50m;
    sendfile on;
    tcp_nopush on;
    keepalive_timeout 120;
    server_tokens off;
    tcp_nodelay on;

    #Aliyun WAF
    set_real_ip_from 112.124.214.0/24;
    set_real_ip_from 42.121.40.0/22;
    real_ip_header X-Forwarded-For;
    real_ip_recursive on;


    ///////////////////////////////////////////////////////////

    [root@SERVER sbin]#vi /library/config.php

    #Aliyun WAF
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }

     
    已获得 admin 的点赞。
正在加载...