- user www www;
- worker_processes auto;
- error_log /www/wwwlogs/nginx_error.log crit;
- pid /www/server/nginx/logs/nginx.pid;
- worker_rlimit_nofile 51200;
- events
- {
- use epoll;
- worker_connections 51200;
- multi_accept on;
- }
- http
- {
- include mime.types;
- #include luawaf.conf;
- include proxy.conf;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] '
- '"$request" $status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"' ;
- set_real_ip_from 0.0.0.0/0;
- real_ip_header X-Forwarded-For;
- server_names_hash_bucket_size 512;
- client_header_buffer_size 32k;
- large_client_header_buffers 4 32k;
- client_max_body_size 50m;
- sendfile on;
- tcp_nopush on;
- keepalive_timeout 60;
- tcp_nodelay on;
- fastcgi_connect_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_read_timeout 300;
- fastcgi_buffer_size 64k;
- fastcgi_buffers 4 64k;
- fastcgi_busy_buffers_size 128k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_intercept_errors on;
- gzip on;
- gzip_min_length 1k;
- gzip_buffers 4 16k;
- gzip_http_version 1.1;
- gzip_comp_level 5;
- gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
- gzip_vary on;
- gzip_proxied expired no-cache no-store private auth;
- gzip_disable "MSIE [1-6]\.";
- limit_conn_zone $binary_remote_addr zone=perip:10m;
- limit_conn_zone $server_name zone=perserver:10m;
- server_tokens off;
- access_log off;
- server
- {
- listen 888;
- server_name www.bt.cn;
- index index.html index.htm index.php;
- root /www/server/phpmyadmin;
- if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") {
- return 444;
- }
- #error_page 404 /404.html;
- include enable-php-56.conf;
- location ~ .*\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm|pdf|mp3|html|htm|apk|dat)$
- {
- expires 365d;
- }
- location ~ /\.
- {
- deny all;
- }
- access_log /www/wwwlogs/access.log;
- }
- include /www/server/panel/vhost/nginx/*.conf;
- }
复制代码 这个文件所在路径
/www/server/nginx/conf/nginx.conf
设置保存之后使用任何的CDN产品都可以获取到用户终端的真实的IP
可以兼容市面上的CDN产品有以下几种
15CDN, 360, 360网站卫士, AKAMAI, Adobe, Akamai, Amazon, Boreus, CDN.NET, CDN77, CDNetworks, CacheFly, Cedexis, Citrix Systems, CloudFlare, Cloudways, DIY Content Delivery Network, DNSPod, DNS盾, Distil, EDONG, EdgeCast, EuroDNS, Fastly, G-Core Labs, GOSUN(高升科技), Google, HEROKU, HIGHWINDS, IPTP Networks, ISPRIME, Incapsula, Instart Logic, Investis, KINX, KeyCDN, LEVEL3, MaxCDN, Microsoft Azure, NameBright, OVH, Omega, Oracle, PANTHEON, Planisys, Rackspace, Reblaze, ReflectedNetworks, Salesforce, Section.io, Secure Sky Technology, SpeedyCloud, Symantec, TAN14, TXNetworks, Ucloud, VOLUUM, WAFCDN, WebLuker, ZENEDGE, dediserve, online.net, 七牛, 万根网络, 上海逸云, 世纪互联, 九曲网科, 云帆加速, 云盾科技, 云端智度, 云端网络, 京东云, 今科科技, 创世云, 加速乐(知道创宇), 动力在线, 华为云, 华夏名网, 华数世纪, 厦门翼讯, 又拍云, 天互数据, 天翼云, 安全宝, 安恒信息, 帝恩思科技, 帝联科技, 广州凡科, 快网科技, 新网互联, 新网数码, 易名中国, 景安网络, 智卓安全, 深信服科技, 牛盾, 白山云, 百度云加速, 百度开放云, 盛大云, 网宿科技, 网快科技, 美团云, 美橙互联, 聚网优速, 腾讯云, 萤火云计算, 蓝云科技, 蓝汛科技, 蓝盾, 西部数码, 视界云, 速必拓, 速网科技, 速致, 金山云, 铱迅信息, 阿里云, 青松云安全, 风云互联, 首途CDN, 魔门云
为了更好的统计到真实的访客信息,可以自行手动去修改,规则中还屏蔽了搜索引擎抓取到888的端口
|
|