提供非子域路由

Serve non-subdomain routes

我想使用 Wordpress 来托管公司的博客。主网站是一个 ASP 应用程序。它们托管在不同的 EC2 实例上。

博客应该有非子域 URL:example.com/blog,而不是 blog.example.com

如何做到这一点?像 Cloudflare 这样的负载平衡工具可以帮助解决这个问题吗?

我尝试使用 Route53 进行某种掩蔽。还尝试在 IIS 中与主站点并排托管博客。

你可以把 nginx upstream of both of them and use it as a reverse proxy 放到他们两个匹配被定位的 URL。

示例 nginx 配置可能如下所示:

server {

  server_name example.com;

  location / {
    proxy_pass http://10.0.0.5;
  }

  location /blog/ {
    proxy_pass  http://10.0.0.6;
  }

}

10.0.0.5 是您的 IIS 服务器 运行 您的 ASP 应用程序,10.0.0.6 是 运行 您的 Wordpress 服务器。

或者您可能想看看 Amazon's API Gateway service,它允许您将流量定向到您选择的端点,这些端点可以是您在 AWS 内的应用程序、AWS 外部某处的服务器、Lambda 函数或漂亮的"talks" HTTP.

的任何东西

CloudFlare 不是 "load-balancing tool" 它是一个基于 nginx 和 DNS 服务的 CDN。我不知道 CloudFlare 提供的任何负载平衡功能。您可以在 CloudFlare 中设置页面规则来完成您想要的。问题是要求您使用 CloudFlare 作为您的 DNS 服务器,这可能不适合您。

您可以按照 ydaetskcoR 的建议,将您自己的 nginx 服务器放在两个 Web 服务器之前。这是我的建议。

Route53是一个DNS系统,只处理域名。它不会帮助你解决这种情况。