2
nginx:为什么我不能将proxy_set_header放在if子句中?
使用此配置: server { listen 8080; location / { if ($http_cookie ~* "mycookie") { proxy_set_header X-Request $request; proxy_pass http://localhost:8081; } } } 重新加载Nginx服务时出现此错误: Reloading nginx configuration: nginx: [emerg] "proxy_set_header" directive is not allowed here in /etc/nginx/conf.d/check_cookie.conf:5 nginx: configuration file /etc/nginx/nginx.conf test failed 此配置可以正常运行,但不能满足我的要求: server { listen 8080; location / { proxy_set_header …