[PATCH] $request_scheme variable

Maxim Dounin mdounin at mdounin.ru
Wed Feb 28 17:09:13 UTC 2018


Hello!

On Tue, Feb 27, 2018 at 10:32:40PM +0000, Chris Branch via nginx-devel wrote:

> Hi, just giving this patch some birthday bumps.
> 
> > On 27 Feb 2017, at 11:58, Chris Branch via nginx-devel <nginx-devel at nginx.org> wrote:
> > 
> > # HG changeset patch
> > # User Chris Branch <cbranch at cloudflare.com>
> > # Date 1488195909 0
> > #      Mon Feb 27 11:45:09 2017 +0000
> > # Node ID 05f555d65a33ebf005fedc569fb52eba3758e1d7
> > # Parent  87cf6ddb41c216876d13cffa5e637a61b159362c
> > $request_scheme variable.
> > 
> > Contains the URI scheme supplied by the client. If no scheme supplied,
> > equivalent to $scheme.
> > 
> > Scheme can be supplied by the client in two ways:
> > 
> > * HTTP/2 :scheme pseudo-header.
> > * HTTP/1 absolute URI in request line.

The $scheme variable is already documented as

: $scheme
: request scheme, “http” or “https”

and introducing additional variable with the $request_scheme might 
not be a good idea.

If we really need this for some reason, we should rather consider 
changing $scheme instead, like we do with $host.  This might be a 
bad idea for other reasons though, as an ability to supply 
incorrect $scheme might cause security problems.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list