分类 Linux 下的文章

使用了cloudflare的网站,可能会莫名的在网站的代码底部出现

https://static.cloudflareinsights.com/beacon.min.js

这个JS脚本,这个脚本是cloudflare的统计分析脚本

如何删除这个脚本呢?

登录cloudflare,点击左侧列表的分析和日志,然后点击Web Analytics

可以看到开启了统计的网站,点击管理站点,点开高级选项之后,就可以看到删除按钮了。

点击删除后,就不会再有这个脚本出现了。

Websites using Cloudflare may inexplicably have the following JS script appear at the bottom of their code:

https://static.cloudflareinsights.com/beacon.min.js

This script is Cloudflare's analytics script.

How can you remove this script?

Log in to Cloudflare, click on "Analytics" and "Logs" in the left sidebar, then click on "Web Analytics."

You will see the websites that have analytics enabled. Click on "Manage Site," open the "Advanced Options," and you will find the delete button.

After clicking delete, this script will no longer appear.

sudo apt update

sudo apt install -y build-essential libssl-dev libssh2-1-dev libpsl-dev libidn2-dev libnghttp2-dev libzstd-dev

cd /tmp

wget https://curl.se/download/curl-8.12.1.tar.gz

tar -xzf curl-8.12.1.tar.gz

cd curl-8.12.1

./configure --with-openssl

make

sudo make install

sudo ldconfig

hash -r

curl -V

网站在使用CloudFlare后,nginx的日志的就无法记录到用户真实的IP地址了

会造成很多问题,无法正确的分析日志

解决办法很简单

在nginx的配置文件:/usr/local/nginx/conf/nginx.conf

http {

下面添加

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;

重启nginx即可正确获取访客的真实IP地址