I'm using nginx as a reverse proxy to apache/mod_wsgi and Django. Currently everything is working fine with / aliasing my wsgi file, and /media aliasing my media directory. However, I want to set it up so that /media/foo/bar also aliases my wsgi file such that /media/foo/example.txt will serve example.txt with apache, but /media/foo/bar/example.txt will be passed along to my urls.py in Django.
I've tried adding another WSGIScriptAlias to my apache.conf above my Alias for /media/, but /media/foo/bar/example.txt is still being served by apache. My apache.conf currently looks like this:
<VirtualHost *:8080>
#DocumentRoot /var/www/mydomain.com/public
ServerName mydomain.com
ErrorLog /var/www/mydomain.com/logs/apache_error_log
CustomLog /var/www/mydomain.com/logs/apache_access_log common
WSGIScriptAlias /media/foo/bar /var/www/mydomain.com/src/myproject/server/django.wsgi
Alias /media/ /var/www/mydomain.com/public/media/
<Directory /var/www/mydomain.com/public/media>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /var/www/mydomain.com/src/myproject/server/django.wsgi
<Directory /var/www/mydomain.com/src/myproject/server>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>