配置 – 为什么我不能将proxy_set_header放在if子句中?
发布时间:2020-05-23 01:45:12 所属栏目:Nginx 来源:互联网
导读:使用此配置:server { listen 8080; location / { if ($http_cookie ~* mycookie) { proxy_set_header X-Request $request; proxy_pass http://localhost:
|
使用此配置:
我重新加载nginx服务时出现此错误:
这个配置工作正常,但它没有做我想要的:
为什么我不能将proxy_set_header指令放在if子句中? 提前致谢! 与proxy_pass不同,您不能将proxy_set_header放在if块中.您只能将其放在http / server / location块中.所以你的第二个配置很好.参考:http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header
不知道$request变量是什么.它没有出现在nginx变量列表中:http://wiki.nginx.org/HttpCoreModule#Variables.你想在这里实现什么? (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 使用nginx提供s3文件
- node.js-是否应将Nginx和HAProxy都用于生产节点应用程序?
- python – 在Nginx反向代理POST请求后面的CherryPy被破坏/截
- Nginx http_status_module统计信息
- Nginx相当于mod_security和相关
- python – `uwsgi_modifier1 30`指令没有从PATH_INFO中删除
- 403错误;不会代理:NginX和Node.js
- Nginx:1M map的最佳map_hash_max_size和map_hash_bucket_s
- asp.net – 如何配置nginx以支持cloudflare下的signalr3?
- Nginx:SNI不适用于具有多个参数的server_name
