如何让Web Server B只能被Web Server A访问

How to make Web Server B only accessible by Web Server A

说明

我需要 post 使用 [=30= 从服务器 AB 形成数据] 将数据存储在数据库中,但我不知道如何安全地 实现此目的以防止跨站点伪造攻击。

问题

我该怎么做?是否只能通过服务器 A 访问服务器 B?

最安全的方法是使用 iptables 或主机。allow/deny 如果您的服务器在 unix 系统上运行。 apache 模块是独立于平台的。但要注意在配置中使用#-comments,因为这可能会使您的服务器容易受到攻击https://vigilance.fr/vulnerability/Apache-httpd-rules-added-by-mod-access-compa‌​t-or-mod-authz-host-16636