#19517: Add support for X-Forwarded-Port to HttpRequest.get_host when
USE_X_FORWARDED_HOST is in use
-------------------------------------+-------------------------------------
     Reporter:  david_k_hess@…       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  HTTP handling        |                  Version:  1.4
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  httprequest,         |             Triage Stage:  Accepted
  get_host, X-Forwarded-Host,        |
  USE_X_FORWARDED_HOST               |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by hgdeoro):

 I have the same problem with bad redirects on the testing environment
 (where the non-standar 8443 port is used). I found a workaround for Nginx.
 Just add:

 {{{
 error_page 497 https://$host:8443$request_uri;
 }}}

 With that configuration, instead of the error message `The plain HTTP
 request was sent to HTTPS port`, your browser receives a redirect to the
 real URL. This is NOT a solution, this introduces an extra redirect, but
 worked for me (and it's better than modifying the aplication, since this
 is a problem I have in the testing environment only).

--
Ticket URL: <https://code.djangoproject.com/ticket/19517#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.92520e609820006fa94deab66cf9bbb0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to