* 仕様書

[REFS[
- [6] [CITE@en[RFC 7239 - Forwarded HTTP Extension]] ([TIME[2014-09-07 05:21:07 +09:00]] 版) <https://tools.ietf.org/html/rfc7239#section-5.4>
]REFS]

* [CODE(HTTP)@en[Forwarded:]] ヘッダー [CODE(HTTP)@en[proto]] 引数

[7] [CODE(HTTP)@en[[[Forwarded:]]]] [[ヘッダー]]の
[DFN[[CODE(HTTP)@en[[[proto]]]]]] [[引数]]は、
用いられている[[プロトコル]]の種類を表します [SRC[>>6]]。

** 値

[8] 値の構文は、 [[URL scheme]] です [SRC[>>6]]。

[FIG(railroad)[
= [[URL scheme]]
]FIG]

[EG[
[9] 典型的な値は [CODE(URI)@en[[[http]]]] や [CODE(URI)@en[[[https]]]] です [SRC[>>6]]。
]EG]

;; [10] 正規形であることは要求されていませんから、[[大文字]]で指定されていても良いことになります。

* 関連

[14] 
[CODE(HTTP)@en[X-Forwarded-*]] 参照。

* 実装

[3] [CODE(HTTP)@en[[[X-Forwarded-Proto:]]]] [SRC[>>1, >>2, >>13]]

[5] [CODE(HTTP)@en[[[X-Forwarded-Scheme:]]]] [SRC[>>1, >>4, >>13]]

[REFS[
- [1] [CITE['''['''#JETTY-628''']''' The scheme is not forwarded when the matching connector is configured with "forwarded=true". - jira.codehaus.org]]
([TIME[2011-08-16 17:57:36 +09:00]] 版)
<http://jira.codehaus.org/browse/JETTY-628>
- [2] [CITE[Amazon Web Services Blog: Keeping Customers Happy - Another New Elastic Load Balancer Feature]]
( ([TIME[2013-06-06 09:46:25 +09:00]] 版))
<http://aws.typepad.com/aws/2010/10/keeping-customers-happy-another-new-elastic-load-balancer-feature.html>
- [4] [CITE[Code Documentation — WSGIProxy v0.1 documentation]]
([TIME[2010-06-11 06:52:19 +09:00]] 版)
<http://pythonpaste.org/wsgiproxy/code.html>
]REFS]

[11] [CITE@en[Read X-Forwarded-Proto header if trustProxy flag set by stongo · Pull Request #1747 · hapijs/hapi]]
( ([TIME[2014-10-26 06:22:11 +09:00]] 版))
<https://github.com/hapijs/hapi/pull/1747/files>

[12] [CITE[Support X-Forwarded-Proto HTTP header ''''''[''''''#313145'''''']'''''' | Drupal.org]]
( ([TIME[2014-10-26 06:24:05 +09:00]] 版))
<https://www.drupal.org/node/313145>

[13] [CITE@en[ProxyHeaders uses X-Forwarded-Scheme, not X-Forwarded-Proto · Issue #79 · gorilla/handlers]]
( ([TIME[2017-06-12 12:11:56 +09:00]]))
<https://github.com/gorilla/handlers/issues/79>

[FIG(quote)[
[FIGCAPTION[
[15] [CITE@en[mod_rewrite - Apache HTTP Server Version 2.5]]
([TIME[2017-08-18 17:24:45 +09:00]])
<https://httpd.apache.org/docs/trunk/mod/mod_rewrite.html#RewriteCond>
]FIGCAPTION]

> HTTPS
> Will contain the text "on" if the connection is using SSL/TLS, or "off" otherwise. (This variable can be safely used regardless of whether or not mod_ssl is loaded).

]FIG]


[FIG(quote)[
[FIGCAPTION[
[16] [CITE@en[mod_rewrite - Apache HTTP Server Version 2.5]]
([TIME[2017-08-18 17:24:45 +09:00]])
<https://httpd.apache.org/docs/trunk/mod/mod_rewrite.html#RewriteCond>
]FIGCAPTION]

> REQUEST_SCHEME
> Will contain the scheme of the request (usually "http" or "https"). This value can be influenced with ServerName.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[17] [CITE[nginx: 62869a9b2e7d]]
([TIME[2017-12-10 13:16:16 +09:00]])
<http://hg.nginx.org/nginx/rev/62869a9b2e7d>
]FIGCAPTION]

> The REQUEST_SCHEME parameter was introduced in Apache 2.3.11 and seems
> to be used by some scripts now.  It looks more logical than previously
> used HTTPS.

]FIG]
