我想通過nginx代理請求頭'HTTP_X_SSL_CLIENT_S_DN'。如何代理http_x_ssl_client_s_dn標頭?
這是我們的服務器網絡結構。
[front server:443] <---> [nginx proxy:8004] <---> [application server:8008]
(client cert auth)
當我試了兩臺服務器([前臺服務器]和[應用服務器]),它工作正常。標頭'HTTP_X_SSL_CLIENT_S_DN'被傳遞給應用程序服務器。
然後添加服務器[nginx proxy],標頭'HTTP_X_SSL_CLIENT_S_DN'未傳遞到應用程序服務器。
我的nginx配置如下。
server {
listen 8004;
index index.html;
location/{
proxy_pass_header Server;
proxy_pass_header X-Scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://app-server/;
# TODO: to proxy 'HTTP_X_SSL_CLIENT_S_DN'
# failed settings
# proxy_pass_request_headers on; # not worked (default: on)
# proxy_pass_header X-SSL-Client-S-DN; # none
# proxy_pass_header X_SSL_CLIENT_S_DN; # none
# proxy_pass_header HTTP_X_SSL_CLIENT_S_DN; # none
# proxy_pass_header HTTP-X-SSL-CLIENT-S-DN; # none
# proxy_set_header X-SSL-Client-S-DN $ssl_client_s_dn; # none
# proxy_set_header X_SSL_Client_S_DN $x_ssl_client_s_dn; # none
# proxy_set_header X-SSL-Client-S-DN $http_ssl_client_s_dn; # none
# proxy_set_header X-SSL-Client-S-DN $http_x_ssl_client_s_dn; # none
}
}
upstream app-server {
server 127.0.0.1:8008;
}
任何幫助適用。
謝謝eli_mach。您的建議有嘗試的價值。我會嘗試你的建議,但我已經失去了我的測試環境。 – superdaigo 2012-10-19 14:30:07
我也使用django。 – superdaigo 2012-10-19 14:35:43