因GDPR而阻止所有欧盟访客

ndk*_*ndk 6 php privacy http ip-address http-headers

GDPR对谁知道什么是违法行为的罚款实施了数百万美元的罚款.PHP中是否有一个简单的免费解决方案来处理我的个人网站?我不需要跟踪人员,但我想至少知道谁在访问,例如我想知道浏览器,操作系统,组织.我当然愿意阻止所有欧盟访客,我知道很多人将他们的浏览器设置为英语,因此语言阻塞是无效的.

作为一个非律师和维护者只是一个没有钱的简单网站,我认识到我永远不会完全理解GDPR,我永远不会有资金随着它的变化而跟上它.只有大公司才能负担得起花费所需的时间,精力和金钱.所以我需要一个简单的机制来阻止欧盟用户,否则,我将不得不采取保守的方法来收集访问者的数据.

这项GDPR法律威胁那些因违规行为而遭受经济死亡的人,但绝大多数人都不知道其模糊规则究竟需要什么.这是一项有利于拥有资源的大公司的法律,是对小公司和个人的攻击.

小智 9

首先,最好先了解合法利益 - https://ico.org.uk/for-organisations/guide-to-the-general-data-protection-regulation-gdpr/legitimate-interests/when - 我们依赖合法利益/ - 然后询问从用户那里收集个人数据的法律依据是什么?

与您的问题相关,实际上有可能通过nginx和GeoIP数据库.

为nginx安装GeoIP数据库:

apt-get install geoip-database-contrib -y
Run Code Online (Sandbox Code Playgroud)

更新你的nginx配置(在...之外server {} block):

# Block the EU continent from accessing the site

geoip_country /usr/share/GeoIP/GeoIP.dat;
geoip_city /usr/share/GeoIP/GeoLiteCity.dat;
map $geoip_city_continent_code $allow_visit {
   default 1;
   EU 0;
}
Run Code Online (Sandbox Code Playgroud)

在您的server {}块中,禁用EU用户的日志记录并返回403:

# Disable logging for EU users
access_log /var/log/nginx/access.log combined if=$allow_visit;
# Block and return 403 error message to EU users
default_type text/plain;
if ($allow_visit = 0) {
        return 403 'You are prohibited from visiting this website due to GDPR compliance requirements.';
    }
Run Code Online (Sandbox Code Playgroud)

重启nginx

service nginx restart
Run Code Online (Sandbox Code Playgroud)

致积于https://medium.com/@jacksonpalmer/gdpr-for-side-projects-blocking-all-eu-traffic-with-nginx-in-3-simple-steps-136ddd8078a4

  • OP声明他们有一个非常简单的网站,所以我假设这是托管在虚拟共享服务器上.这意味着OP无法在他的小型站点上部署它,因为他无法访问只读模式之外的服务器日志. (2认同)