简体   繁体   English

如何防止用户访问 GCP 中托管的网站的 IP 地址?

[英]How to prevent user access to IP address for a website hosted in GCP?

I have a Wordpress website (Bitnami) thats hosted in Google Cloud Platform.我有一个托管在 Google Cloud Platform 中的 Wordpress 网站(Bitnami)。 The IP address is something like: 33.33.33.33 . IP 地址类似于: 33.33.33.33 My domain is hosted on Google Domains and has 2 nameservers pointing to Cloudflare.我的域托管在 Google Domains 上,并且有 2 个指向 Cloudflare 的名称服务器。 On the Cloudflare DNS settings, I have 2 A records, one is ftp and the other is something like 'mywebsite.com'.在 Cloudflare DNS 设置中,我有 2 条 A 记录,一条是 ftp,另一条类似于“mywebsite.com”。 I also have a CNAME which is www mywebsite.com.我还有一个CNAME ,即 www mywebsite.com。

I am able to hit the full URL of my website but I also notice I can enter the IP address and it also works and loads the website.我可以访问我网站的完整 URL 但我也注意到我可以输入 IP 地址,它也可以工作并加载网站。 Is it possible to prevent acccess to 33.33.33.33 and only allow the full URL?是否可以阻止访问33.33.33.33并且只允许完整的 URL?

Create VPC Firewall Rules that only allow Cloudflare IP addresses.创建仅允许 Cloudflare IP 地址的 VPC 防火墙规则。

Consult this document for the current Cloudflare IP list.有关当前的 Cloudflare IP 列表,请参阅此文档

Google Cloud VPC firewall rules overview Google Cloud VPC 防火墙规则概览

Note: Cloudflare does not support FTP, so you must point your DNS resource record for FTP to your server's IP address and not through Cloudflare. Note: Cloudflare does not support FTP, so you must point your DNS resource record for FTP to your server's IP address and not through Cloudflare. I recommend that you do not use FTP.我建议您不要使用 FTP。 Use SSH/SFTP for file transfers.使用 SSH/SFTP 进行文件传输。 Configure WordPress so that installing plugins, uploading images, etc do not require FTP.配置 WordPress 以便安装插件、上传图片等不需要 FTP。 FTP is not encrypted which means your login username and password are sent in the clear. FTP 未加密,这意味着您的登录用户名和密码以明文形式发送。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何找到私有区域中托管的 GCP Cloud DNS 服务器的内部 IP 地址 - How to find the Internal IP Address of GCP Cloud DNS server hosted in Private Zone 如何将用户的 IP 重定向到网站 IP? - How to redirect user's IP into a website IP? GCP:如何通过 IP 从 inte.net 访问在 gcp 中的 pod 中运行的 L2 VM (qemu)? - GCP: How to access a L2 VM (qemu) running in a pod in gcp by IP from internet? 如何按域、域的 IP 或 GKE 入口 IP 限制 GCP 负载均衡器访问? - How do I restrict GCP load balancer access by domain, domain's IP or GKE ingress IP? GCloud:如 GCP 控制台中所示,按“正在使用”列过滤 IP 地址 - GCloud: Filter IP Address by 'In Use by' Column as seen in GCP Console 创建 GCP 多个 VM - Output IP 地址 - Create GCP Multiple VM's - Output IP address 无法访问 Kube.netes Service IP 地址的工作负载 - Unable to access workload at the IP address of the Kubernetes Service 如何在 GCP 上设置托管区域? - How do I set up a hosted zone on GCP? 如何使用 A 记录将 GCP 负载均衡器 IP map 到自定义域? - How to map a GCP Loadbalancer IP to a custom domain using A Records? 如何指定 GCP 数据流的 IP 号? - How can I specify the IP number of GCP's Dataflow?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM