Commit 6a10685
committed
Only set X-Forwarded-Proto when header not set
When the seafile docker container
is behind a proxy that does the TLS termination,
such that the seafile docker sees HTTP only,
then, it receives requests
where the following headers are set in the following way:
X-Forwarded-Proto: https
X-Forwarded-Ssl: on
Because the default NGINX template has this directive:
proxy_set_header X-Forwarded-Proto $scheme
the request gets transmitted to gunicorn with the following,
contradictory values:
X-Forwarded-Proto: http
X-Forwarded-Ssl: on
Thus Seafile rejects the requests
with a "Contradictory scheme headers" error.
We instead change the header only when it is not set.
Fixes #226.1 parent 833d5be commit 6a10685
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments