我们使用的是 cloudflare 代理,因此真实 IP 被隐藏了。但是如果您知道真实 IP,您仍然可以使用它访问网站。有没有办法限制该 IP 的访问?
我是说:
by domain: https://some-domain.com -> OK
by proxy IP: https://1.2.3.4 -> OK
by real IP: https://5.6.7.8 -> to restrict.
或者说试图限制它是毫无意义的?
nginx.conf 服务器块的示例:
server {
listen 80 default_server;
server_name some-domain.com;
return 301 https://$host$request_uri;
}
charset utf-8;
server {
server_name some-domain.com;
listen 443 ssl http2;
...
...
}