-
Notifications
You must be signed in to change notification settings - Fork 4
/
219.txt
42 lines (29 loc) · 1.54 KB
/
219.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
* 仕様書
[REFS[
- [1] [CITE@en[psgi-specs/PSGI.pod at master · plack/psgi-specs]] ([TIME[2017-06-07 13:58:55 +09:00]]) <https://github.com/plack/psgi-specs/blob/master/PSGI.pod#user-content-The-Environment>
]REFS]
* 値
[2] [CODE[psgi.url_scheme]] の値は、[[要求URL]]によって [CODE[http]] または [CODE[https]]
[SRC[>>1]]
とされています。
[3] 「要求URL」と規定されていることから[[対象URL]]の[F[scheme][URL scheme]]のようにも思えますが、
だとすると [CODE[http]] でも [CODE[https]] でもないときにどう扱うべきかが謎です。
[4] 実装によっては[[下位層の接続]]が [[TCP]] か [[TLS]] かによって値を決めています。
[5] [CODE[X-Forwarded-*]] のような[[要求ヘッダー]]を検査して、
[[逆プロキシ]]を経由した時点での[[下位層の接続]]の種類によって値を設定する
[[Plackミドルウェア]]もあるようです。
[8]
[CODE[p6w.url-scheme]] は、
[[WebSocket]] の時 [CODE[ws]] や [CODE[wss]] のような値を使います。
* メモ
[6] [CITE@en[uwsgi protocol magic variables — uWSGI 2.0 documentation]]
([TIME[2017-05-19 04:33:44 +09:00]])
<http://uwsgi-docs.readthedocs.io/en/latest/Vars.html#uwsgi-scheme>
[FIG(quote)[
[FIGCAPTION[
[7] [CITE@en[uwsgi/psgi_plugin.c at master · unbit/uwsgi]]
([TIME[2017-06-07 14:46:23 +09:00]])
<https://github.com/unbit/uwsgi/blob/master/plugins/psgi/psgi_plugin.c>
]FIGCAPTION]
> // psgi.url_scheme, honour HTTPS var or UWSGI_SCHEME
]FIG]