Welcome! Log In Create A New Profile

Advanced

Re: Conditionally set header in proxy

May 18, 2011 12:44AM
On Tue, May 17, 2011 at 01:14:30PM -0700, Mitchell Hashimoto wrote:
> Hello,
>
> I'm doing SSL termination in nginx, and I'd like to set a header such as
> "X-Sheme https" ONLY if X-Scheme is not set. The reason is because an
> upstream load balancer may have terminated SSL as well, and I don't want to
> overwrite that value.
>
> Is this possible?

nginx-0.9.0+:

http {
map $http_x_scheme $x_scheme {
"" https;
default $http_x_scheme;
}

server {

location / {

proxy_set_header X-Scheme $x_scheme;


--
Igor Sysoev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Conditionally set header in proxy

Mitchell Hashimoto May 17, 2011 04:16PM

Re: Conditionally set header in proxy

Igor Sysoev May 18, 2011 12:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready