if-statement - 如何通过 NGINX 中的标头值创建 proxy_pass 联结?
问题描述
我想做这样的事情:
location / {
if($http_x_my_header == 'some-value') {
proxy_pass "https://a/";
}
# else
proxy_pass "https://b/";
}
因为我知道在 NGINX 中使用“IF”可能会有问题:我将如何解决以下“最佳实践”?
解决方案
推荐阅读
- magento2 - 如何从magento 2中的子产品(简单)中获取选项
- javascript - Mongoose .Populate() 返回空数组
- javascript - Vue.js 不会在输入更新的控制台数据中显示 - 任何错误
- angular - Angular 7:ngModel 数据绑定不会在单元测试中更新组件属性
- mysql - 哪些自行车在 12 月 8 日上线?
- angular - 从父组件访问子路由参数
- reactjs - React SPA动态环境配置
- laravel - 如何隐藏 Laravel Nova 上的编辑/删除/查看按钮?
- android - 如何使用 Orchestrator 运行从 android studio 到 firebase 的仪器测试?
- css - 如何在同一个类之间隐藏带有css的元素