nginx reverse proxy to apache mod_wsgi doesn't work

Posted by user11243 on Server Fault See other posts from Server Fault or by user11243
Published on 2010-06-08T23:31:50Z Indexed on 2010/06/08 23:32 UTC
Read the original article Hit count: 294

I'm trying to run a django site with apache mod-wsgi with nginx as the front-end to reverse proxy into apache.

In my Apache ports.conf file:

NameVirtualHost 192.168.0.1:7000
    Listen 192.168.0.1:7000

    <VirtualHost 192.168.0.1:7000>
    DocumentRoot /var/apps/example/
    ServerName example.com

    WSGIDaemonProcess example
    WSGIProcessGroup example

    Alias /m/ /var/apps/example/forum/skins/
    Alias /upfiles/ /var/apps/example/forum/upfiles/
    <Directory /var/apps/example/forum/skins>
            Order deny,allow
            Allow from all
    </Directory>

    WSGIScriptAlias / /var/apps/example/django.wsgi

    </VirtualHost>

In my nginx config:

server {
        listen       80;
        server_name  example.com;

        location / {            
            include /usr/local/nginx/conf/proxy.conf;
            proxy_pass http://192.168.0.1:7000;
            proxy_redirect default;
            root /var/apps/example/forum/skins/;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

After restarting both apache and nginx, nothing works, example.com simply hangs or serves index.html in my /var/www/ folder.

I'd appreciate any advice to point me in the right direction. I've tried several tutorials online to no avail.

© Server Fault or respective owner

Related posts about apache2

Related posts about nginx