I'm using nginx, apache2/mod_wsgi. Instead of my protected directory
being concatenated to my MEDIA_URL it's being concatenated to my
MEDIA_ROOT i.e., instead of http://mysite.com/site_media/protected/filename.zip
-- it's being generated as --
http://mysite.com/home/username/public_html/mysite.com/site_media/protected/filename.zip.
I have the apache mod_xsendfile installed and the two flags set in the
vhost config.

---------- nginx ----------

server {
        listen       80;
        server_name  mysite.com    www.mysite.com; # ex: www.mysite.com

        # rewrite for secure checkout
        location  ~ ^/shop/checkout/ {
            rewrite ^/(.*) https://mysite.com/$1 permanent;
        }

        location / {
            proxy_pass         http://mysite.com:8080/;
            include /etc/nginx/proxy.conf;
        }


        # Static files location, requires that you create this folder
separately
        location /site_media/ {
            root   /home/username/public_html/mysite.com/;
        }

        # Admin templates location
        location /admin_media/ {
            root   /home/username/public_html/mysite.com/;
        }

        location /protected/{
            internal;
            root   /home/username/public_html/mysite.com/site_media/;
        }

    }

---------- apache ----------

<VirtualHost *:8080>

  ServerName mysite.com
  ServerAdmin [email protected]
  ServerAlias www.mysite.com

  DocumentRoot /home/username/public_html

  WSGIScriptAlias / /usr/local/www/wsgi/mysite.wsgi
  WSGIDaemonProcess mysite.com threads=5 display-name=%{GROUP}
  WSGIProcessGroup mysite.com

  <Directory /usr/local/www/wsgi>
  Order allow,deny
  Allow from all
  </Directory>

  <Directory /home/username/public_html/mysite.com/public/media/
protected>
  Order deny,allow
  Deny from all
  </Directory>


  # Custom log file locations
  LogLevel info
  ErrorLog  /home/username/public_html/mysite.com/logs/error.log
  CustomLog /home/username/public_html/mysite.com/logs/access.log
combined

  XSendFile on
  XSendFileAllowAbove on

  RPAFenable On
  RPAFsethostname On
  RPAFproxy_ips 127.0.0.1

</VirtualHost>

---------- wsgi ----------

import os, sys

sys.path.append('/home/username/public_html/mysite.com')
sys.path.append('/home/username/public_html/mysite.com/mysite')

os.environ['PYTHON_EGG_CACHE'] = '/home/username/public_html/
mysite.com/.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi

_application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
    environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME',
'http')
    return _application(environ, start_response)
-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.


Reply via email to