acl - 特定域的 HA 代理替换标头不起作用
问题描述
我在 HA 代理配置文件中添加了以下 acl 和后端:
acl app-web hdr(host) -i example.com
use_backend www-web if app-web
#For google fonts : /icon /css and url parameter 'family'
acl app-css path -i -m beg /css
acl app-cssurl urlp(family) -m found
use_backend www-fonts if app-css app-cssurl
use_backend www-fonts if { path_beg /icon }
#For static content serving from aws s3 bucket
use_backend www-frontend if { path_beg /css /js /img /assets /corber /moment-locales /favicon.ico }
#web server backend serving nodejs app
backend www-web
redirect scheme https if !{ ssl_fc }
server webapp 10.0.0.1:8000 check
#backend for google fonts
backend www-fonts
mode http
option forwardfor
http-request replace-header Host .* fonts.googleapis.com
server www-fonts fonts.googleapis.com:443 ssl verify none
#backend for static content from s3 bucket
backend www-frontend
mode http
option forwardfor
http-request replace-header Host .* staticbucket.s3.ap-south-1.amazonaws.com
server www-frontend staticbucket.s3.ap-south-1.amazonaws.com:443 ssl verify none
现在,当我们点击www.example.com url 时,谷歌字体和静态内容就被排除在外了。但是,如果我们没有任何子域,即 example.com,它就会调用 www-web 后端。谷歌字体和静态内容没有加载。
我们应该进行什么配置以允许 example.com(没有子域)提供来自 s3 和 google 字体的静态内容?
解决方案
推荐阅读
- svelte - 如何从 Svelte 中的端点为组件创建动态页面?
- generics - 在 trait 对象中使用泛型类型参数的引用问题是什么?
- ios - 当我调用异步发布请求时如何发送正文中的值
- r - 在R中的方法中将对象转换为字符串
- javascript - 使用 Tampermonkey 到达最后一页时停止函数
- graphql - 什么是 GraphQL 中的标量类型
- model - 如何在 UIMA Ruta 中为外部分析引擎设置模型
- postgresql - postgresql 根据存储在另一个表中的值更新表列
- python - 如何使用 Python 脚本将文件从 SFTP 位置下载到 Google 存储桶
- python - 如何将每一行解析为熊猫的第二列