Google App-Engine按国家/地区阻止传入流量? [英] Google App-Engine block incoming traffic by country?

查看:126
本文介绍了Google App-Engine按国家/地区阻止传入流量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究通过Google的PHP App Engine开发系统。我现在正在进行中,但意识到我不知道一个好方法来拒绝来自以其恶毒居民闻名的国家的传入流量。

在其他网站上,我只是通过.htaccess阻止子网。但是,现在我开始认为除了使用Google自己的指定国家/地区代码的PHP请求标头之外,这是不可能的。



请在此处查看他们的文档:https: //developers.google.com/appengine/docs/php/



这样很容易阻止它,但我不确定这将是最佳的方式。



任何洞察力将不胜感激。

解决方案

您可以使用 dos.yaml 文件将子网列入黑名单。您可以在应用程序的根目录下创建一个 dos.yaml 文件,然后根据指定的这里。请注意,此文件最多限制为100个条目。



一旦您有一个您希望阻止的国家子网列表(您可以从列表中获得) 这个),你可以手动填充 dos.yaml 文件。或者,您可以使用这样的脚本来填充文件。


I'm looking into developing a system via Google's App Engine for PHP. I'm now pretty well underway, but realized that I don't know a good way to deny incoming traffic from countries known for their nefarious inhabitants.

On other sites, I just block subnets via .htaccess. However, I'm now beginning to think it's impossible outside of using Google's own PHP request header designating the country code.

See their doc here: https://developers.google.com/appengine/docs/php/

It would be easy to just block it that way, but I'm not sure this would be the optimal way.

Any insight would be appreciated.

解决方案

You can use the dos.yaml file to blacklist subnets. You create a dos.yaml file in the root directory of your application and then block IPs or entire subnets as specified here. Note that this file is limited to a maximum of 100 entries.

Once you have a list of country subnets which you wish to block (which you could obtain from a list like this or this), you can populate the dos.yaml file manually. Alternatively, you can use a script like this one to populate the file.

这篇关于Google App-Engine按国家/地区阻止传入流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆