CloudflareCDN+nginx配置特定IP访问限制

Cloudflare公开中国节点IP段
https://www.cloudflare.com/zh-cn/ips/

# 获取CF代理IP
# 配置加入nginx Server前
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;

real_ip_header CF-Connecting-IP;

map $HTTP_CF_CONNECTING_IP  $cfIp {
~^(?P<firstaddr>[0-9.]+),?.*$    $firstAddr;
}</firstaddr>

map $cfIp $allowIp {
default 0;
# 白名单ip
"xx.xx.xx.xx" 1;
"xx.xx.xx.xx" 1;
}
#拦截非CF的ip
# 加入nginx配置Server内
if ($allowIp = 0) {
return 403;
}

Cloudflare ip段需要自己定期更新维护

,

Related posts

wsl2使用genie守护进程

安装 wsl-transdebian

sudo apt install apt-transport-https

wget -O /etc/apt/trusted.gpg.d/wsl-transdebian.gpg https://arkane-systems.github.io/wsl-transdebian/apt/wsl-transdebian.gpg

chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

cat << EOF > /etc/apt/sources.list.d/wsl-transdebian.list
deb...

Linux中rz和sz命令用法详解

在linux中rz 和 sz 命令允许开发板与主机通过串口进行传递文件了,下面我们就来简单的介绍一下rz 和 sz 命令的例子。

rz,sz是Linux/Unix同Windows进行ZModem文件传输的命令行工具。

优点就是不用再开一个sftp工具登录上去上传下载文件。

sz:将选定的文件发送(send)到本地机器

rz:运行该命令会弹出一个文件选择窗口,从本地选择文件上传到Linux服务器

安装命令:

yum install lrzsz

从服务端发送文件到客户端:

sz filename

从客户端上传文件到服务端:

rz

在弹出的框中选择文件,上传文件的用户和组是当前登录的用户

SecureCRT设置默认路径:

Options -> Session Options ->...

Linux shell用法和技巧

检查远程端口是否对bash开放:
echo >/dev/tcp/8.8.8.8/53 && echo "open"
让进程转入后台:
Ctrl + z
将进程转到前台:
fg
产生随机的十六进制数,其中n是字符数:
openssl rand -hex n
在当前shell里执行一个文件里的命令:
source /home/user/file.name
截取前5个字符:
${variable:0:5}
SSH debug 模式:
ssh -vvv...

Latest posts

git系统间换行符的问题CRLF/LF/CR

CR回车 LF换行Windows/Dos CRLF \r\n
Linux/Unix LF \n
MacOS CR \r

一、AutoCRLF
#提交时转换为LF,检出时转换为CRLF
git config --global core.autocrlf true

#提交时转换为LF,检出时不转换
git config --global...

数据采集触发防火墙

通过dns分析,目标网站使用阿里云ECS云盾.网站流量先经过aliyunddos1001.com服务器

经过反复尝试将之前Curl请求改成基于HTTP_Request2的Socket请求,顺利绕过防火墙.
通过tcpdump抓包比较

# socket
23:37:37.498916 IP localhost.58718 > localhost.http: Flags , seq 258486799, win 65495, options [mss...

wsl2使用genie守护进程

安装 wsl-transdebian

sudo apt install apt-transport-https

wget -O /etc/apt/trusted.gpg.d/wsl-transdebian.gpg https://arkane-systems.github.io/wsl-transdebian/apt/wsl-transdebian.gpg

chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

cat << EOF > /etc/apt/sources.list.d/wsl-transdebian.list
deb...

CloudFlare的SSL证书浏览器提示不安全原因

Cloudflare Origin CA 证书安装说明

1、先创建CA证书

2、将证书文件下载

3、获取CloudFlare的根证书

4、将根证书合并的xxxxx.pem的后面

再将证书部署到服务器,浏览器刷新显示“连接安全”。

linux 下设置系统时间

第一步 timedatectl set-ntp 0 关闭时间同步

以ubuntu为例子

# 修复地区时间问题

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

date -s '2017-07-26 00:00:00'

0 comments

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI tools for business which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI art generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI time management tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI recruitment tools please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI productivity tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI Video Generation & Editing please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    best free AI tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI photo generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI tools to automate tasks which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI voice cloning please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI music creator which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    best AI image generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI translation tool which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI character generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI RPA tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    common AI tools please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI homework helper which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI voiceover generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI grammar checker which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI video enhancer please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI image enhancer which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI lyrics generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI text to image generator which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI vocal remover please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI for data analysis which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI text generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI email assistant which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI image editing tools please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    best AI tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI image generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI time management tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI song generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI voiceover generator which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI applications please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    popular AI tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    realistic AI image generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI story writer which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    beginner AI tools please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI analytics tools which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI song generator please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI avatar generator which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI tools for developers please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Discover the power of artificial intelligence with our AI Toolkit, your ideal solution for any task!
    Discover over 107 advanced tools such as
    AI tools to increase productivity which turn creativity, productivity, and efficiency into effortless success. This comprehensive set of tools will help you solve any problem.,
    from content creation to data analysis. Experience innovation today!
    AI scheduling assistant please contact our technical support, we work 24/7

  • Your comment is awaiting moderation.

    Unleash Your Inner Beauty with Undress Photo AI!

    Create stunning photos effortlessly—perfect looks that highlight your unique charm.
    Captivate hearts, amaze friends, and inspire yourself!
    Experience the magic at an affordable price.
    for all questions, please contact the links ===>>
    Nudevision beta access

  • Your comment is awaiting moderation.

    Unleash Your Inner Beauty with Undress Photo AI!

    Create stunning photos effortlessly—perfect looks that highlight your unique charm.
    Captivate hearts, amaze friends, and inspire yourself!
    Experience the magic at an affordable price.
    for all questions, please contact the links ===>>
    AI art nude fantasy tool

  • Your comment is awaiting moderation.

    Уникальное предложение для вашего бизнеса!

    Ищете быстрые и недорогие решения для продвижения? Мы предлагаем прогоны с помощью Хрумера и ГСА по собственным уникальным базам!

    Почему выбирают нас?
    - Доступные цены без скрытых платежей
    - Мгновенные результаты — ваш сайт начнет получать трафик уже сегодня!
    - Уникальные базы, которые обеспечивают максимальную эффективность
    - Индивидуальный подход к каждому клиенту

    Не упустите шанс повысить видимость своего сайта и привлечь новых клиентов! Обращайтесь к нам и получите бесплатную консультацию.

    Свяжитесь с нами прямо сейчас и узнайте, как мы можем помочь вашему бизнесу вырасти! узнайте все подробности можно ====>>> ЗДЕСЬ

Leave a Comment

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注