Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#20520 closed Bug (invalid)

Bug when using nginx+apache not listening on 80 port.

Reported by: himikhimik@… Owned by: nobody
Component: HTTP handling Version: 1.4
Severity: Normal Keywords: nginx apache
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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

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/ -> fix_location_header function.
If do comment the string

  response["Location"] = request.build_absolute_uri(response["Location"])

the POST requests work ok.

There are my config files.

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_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;



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/

    <Directory /srv/vertex/src>
            Order deny,allow
            Allow from all


Change History (3)

comment:1 Changed 6 years ago by anonymous

Version: 1.51.4

comment:2 Changed 6 years ago by himikhimik@…

Resolution: invalid
Status: newclosed

comment:3 Changed 6 years ago by himikhimik@…

Resolved by removing wrong nginx.conf properties with proxy_set_header directive.

Note: See TracTickets for help on using tickets.
Back to Top