简体   繁体   English

Akamai 中基于 URL 的请求标头

[英]URL based request headers in Akamai

I have a requirement where I need to have separate vhosts file in apache for same domain and different path.我有一个要求,我需要在 apache 中为相同的域和不同的路径设置单独的 vhosts 文件。 The reason behind separate vhosts is something for business use case.单独虚拟主机背后的原因是为了业务用例。

All I want to know is that for different URL what kind of settings can be introduced on Akamai CDN so that I have different host headers sent to my webserver.我只想知道对于不同的 URL 可以在 Akamai CDN 上引入什么样的设置,以便我将不同的主机标头发送到我的网络服务器。 for eg.例如。 www.foo.com/abc sends a host header of abc.foo.com www.foo.com/abc发送一个主机 header 的 abc.foo.com

Any other solution is also appreciated任何其他解决方案也表示赞赏

Yes, you can specify what Host header is sent to your origin based on any number of criteria including the path.是的,您可以根据包括路径在内的任意数量的条件指定将哪个Host header 发送到您的来源。 There are a few ways you can do this.有几种方法可以做到这一点。 Here's one example.这是一个例子。

  1. Create and declare Property Variable(s) to hold the pieces of the requesting path that you want to use for generating the origin Host value.创建并声明属性变量以保存要用于生成原始Host值的请求路径的片段。 属性变量声明
  2. Create behaviors that extract the pieces of the path you want to use for constructing the origin Host header. In this case, I'm pulling out the first part of the path and storing it as PMUSER_ORIGINHOST_PART1 and the second part of the path as PMUSER_ORIGINHOST_PART2 .创建提取要用于构建源Host header 的路径片段的行为。在本例中,我将提取路径的第一部分并将其存储为PMUSER_ORIGINHOST_PART1并将路径的第二部分存储为PMUSER_ORIGINHOST_PART2 ( Documentation on how to use the "Path Component Offset" is at techdocs.akamai.com.) 有关如何使用“路径组件偏移量”的文档位于 techdocs.akamai.com。) 在此处输入图像描述
  3. Finally, use the variables to construct a custom value for the Host header going to your origin like below.最后,使用变量为Host header 构造自定义值,如下所示。 在此处输入图像描述

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM