簡體   English   中英

我可以在 NGINX 中執行 GeoIP 阻止而無需為 NGINX Plus 付費嗎?

[英]Can I perform GeoIP blocking in NGINX without having to pay for NGINX Plus?

我是 Fedora 29 最終用戶,正在尋找一種通過 NGINX 執行 GeoIP 阻塞的方法,而無需為 Nginx Plus 支付大量美元。 我看到 NGINX 可以設置為包含模塊,想問問是否有任何開源模塊可用於執行基本的 GeoIP 阻塞。

謝謝,

您可以通過在 nginx 構建配置中添加“--with-http_geoip_module”來構建 nginx 並從 nginx https://nginx.org/en/docs/http/ngx_http_geoip_module.html添加 geoip 模塊。

然后在您的 nginx.conf 中指定 geoip_country 或 geoip_city 后跟一個 geoip db 的路徑

https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-by-geoip/還可以幫助為開源或 nginx plus 設置 geoip

編輯:GeoIP 已棄用,但仍可用於現有安裝。

您可以從這里的源代碼構建 GeoIP2 https://github.com/leev/ngx_http_geoip2_module與 nginx 以與以前類似的方式

這是較新的 geoip2 數據庫Geolite2 Country

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM