【发布时间】:2013-11-14 02:28:24
【问题描述】:
我使用 Nginx 作为代理来过滤对我的应用程序的请求。在“http_geoip_module”的帮助下,我正在创建一个国家代码 http-header,我想使用“headers-more-nginx-module”将它作为请求标头传递。这是 Nginx 配置中的 location 块:
location / {
proxy_pass http://mysite.com;
proxy_set_header Host http://mysite.com;;
proxy_pass_request_headers on;
more_set_headers 'HTTP_Country-Code: $geoip_country_code';
}
但这只会在响应中设置标题。我尝试使用“more_set_input_headers”而不是“more_set_headers”,但是标题甚至没有传递给响应。
我在这里错过了什么?
【问题讨论】:
-
同时检查你是否在 docker swarm 集群内的 docker 容器上运行 nginx,如果是,那么你必须关注this steps
标签: nginx proxy http-headers