﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20520	Bug when using nginx+apache not listening on 80 port.	himikhimik@…	nobody	"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>
  }}}
}}}"	Bug	closed	HTTP handling	1.4	Normal	invalid	nginx apache		Unreviewed	0	0	0	0	0	0
