#20520: Bug when using nginx+apache not listening on 80 port.
-------------------------------+--------------------------
     Reporter:  himikhimik@…   |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  HTTP handling  |    Version:  1.5
     Severity:  Normal         |   Keywords:  nginx apache
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------------
 I made nginx and apache servers working together.
 Nginx is listening on 81 port, serving all media files and passing all
 other requests to apache.
 Apache is listening on 88 port and serving all other requests by means of
 wsgi.py.

 When one makes GET request all work ok. But when one makes POST with
 redirect to another
 page the redirect leads to 80 port instead of 81 port (when just saving
 any object on django admin site).

 The problem is incorrect forming POST headers.
 django/http/utils.py -> fix_location_header function.
 If do comment the string
 {{{
 #!div style="font-size: 80%"
   {{{#!python
     response["Location"] =
 request.build_absolute_uri(response["Location"])
   }}}
 }}}
 the POST requests work ok.

 There are my config files.
 nginx.conf:
 {{{
 #!div style="font-size: 80%"
   {{{#!python
 server {

     listen 81;

     access_log /var/log/nginx/vertex.access.log;
     error_log /var/log/nginx/vertex.error.log;

     location /static/ {
         alias /srv/vertex/media/admin_static/;
         expires 30d;
     }

     location /site-media/ {
         alias /srv/vertex/media/;
         expires 30d;
     }

     location / {
         proxy_pass http://127.0.0.1:88/;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }

 }
   }}}
 }}}

 apache2.conf:
 {{{
 #!div style="font-size: 80%"
   {{{#!python
 Listen 88

 <VirtualHost *:88>

     WSGIDaemonProcess localhost python-
 path=/srv/vertex/src:/srv/vertex/env/lib/python2.7/site-packages
     WSGIProcessGroup localhost

     WSGIScriptAlias / /srv/vertex/src/wsgi.py

     <Directory /srv/vertex/src>
         <Files wsgi.py>
             Order deny,allow
             Allow from all
         </Files>
     </Directory>

 </VirtualHost>
   }}}
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20520>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.3ddca696648088480e017c61200eb095%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to