Changes between Version 2 and Version 5 of Ticket #27961
- Timestamp:
- Mar 21, 2017, 2:26:52 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27961 – Description
v2 v5 2 2 1. Both default settings: 3 3 Nginx setting: `proxy_set_header X-Forwarded-Proto $scheme;` 4 Django setting: `HTTP_X_FORWARDED_PROTO=None`4 Django setting: ~~`HTTP_X_FORWARDED_PROTO=None`~~ `SECURE_PROXY_SSL_HEADER = None` 5 5 Result: ''No redirect.'' I'm not getting a ''ERR_TOO_MANY_REDIRECTS'' complain from Chrome. 6 6 7 7 2. Use default setting in nginx; use a wrong setting in Django, i.e. the 'httpsssss' part: 8 8 `proxy_set_header X-Forwarded-Proto $scheme;` 9 `HTTP_X_FORWARDED_PROTO='httpssssssss'` 9 ~~`HTTP_X_FORWARDED_PROTO='httpssssssss'`~~ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'httpssssssss') 10 10 ''No redirect.'' 11 11 12 12 3. Use default setting in nginx; use a wrong setting in Django: 13 13 `proxy_set_header X-Forwarded-Proto $scheme;` 14 `HTTP_X_FORWARDED_PROTASDF='httpssssssss'` 14 ~~`HTTP_X_FORWARDED_PROTASDF='httpssssssss'`~~ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTASDF', 'httpssssssss') 15 15 ''No redirect.'' 16 16 17 17 4. Use custom HTTPS indicator in both nginx and Django: 18 18 proxy_set_header X-Forwarded-Protooo $scheme; 19 `HTTP_X_FORWARDED_PROTOOO='https'` 19 ~~`HTTP_X_FORWARDED_PROTOOO='https'`~~ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOOO', 'https') 20 20 ''No redirect.'' This is the expected behavior. 21 21 22 22 5. Use custom HTTPS indicator in both nginx and Django, and testing for a unsafe protocol ( != 'https'): 23 23 proxy_set_header X-Forwarded-Protooo $scheme; 24 `HTTP_X_FORWARDED_PROTOOO='httpsssss'` 24 ~~`HTTP_X_FORWARDED_PROTOOO='httpsssss'`~~ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOOO', 'httpsssss') 25 25 Chrome complains ''ERR_TOO_MANY_REDIRECTS''. This is the expected behavior. 26 26 … … 35 35 And set: 36 36 `proxy_set_header X-Forwarded-Proto $scheme;` 37 `HTTP_X_FORWARDED_PROTO='httpssssssss'` 37 ~~`HTTP_X_FORWARDED_PROTO='httpssssssss'`~~ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'httpssssssss') 38 38 Chrome would report the expected ''ERR_TOO_MANY_REDIRECTS''. 39 39