Ryan gives one of the answers for letting django SSLRedirectMiddleware
handle things.

If you want to do it purely with Apache, the following should give you
a rough idea of what to do.

RewriteEngine on
RewriteBase /checkout
RewriteCond %{HTTPS} ^off$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

Lather rinse, repeat for each thing that should be locked down.

I'm sure someone else's apache foo is better than mine and give a more
succinct form.

On Oct 21, 9:19 pm, neridaj <[email protected]> wrote:
> correction, the rewrite rule isn't rewriting the url. If I manually
> enterhttps://domain.com/shop/checkout/I get an infinite loop. I
> can't get nginx to rewrite http:// to https:// using:
>
>         # rewrite for secure checkout
>         location  ~ ^/shop/checkout/ {
>             rewrite ^/(.*)https://dzopastudio.com/$1permanent;
>         }
>
> On Oct 21, 3:58 pm, neridaj <[email protected]> wrote:
>
> > I can't get ssl working on my checkout pages and found a post about
> > adding a rewrite rule for nginx but when I do this firefox tells me
> > I've created an infinite loop i.e., "Firefox has detected that the
> > server is redirecting the request for this address in a way that will
> > never complete." I have proxy_set_header X-Url-Scheme $scheme; in my
> > nginx.conf and my wsgi wrapper is as follows:
>
> > import os, sys
>
> > apache_configuration= os.path.dirname(__file__)
> > project = os.path.dirname(apache_configuration)
> > workspace = os.path.dirname(project)
> > sys.path.append(workspace)
>
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.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