On Thu, Dec 17, 2009 at 13:00, Chris McCann <[email protected]> wrote:

> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]
>

Yes, this is a useful bit. It's pretty much all you would want in the
VirtualHost responding to the non-HTTPS on port 80.

<VirtualHost *:80>
  ServerName example.com
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]
</VirtualHost>

The point here is that you're not even telling it anything about the Rails
app. (I can't recall offhand if DocumentRoot is absolutely required here, to
be safe you could set it to something harmless and sandboxed.)

The basic idea is that you should set up the app under a VirtualHost
configured *only* for SSL. The redirect is just an optional bit of
politeness for any existing HTTP links in the wild. That's really all there
is to it.

Good luck!

-- 
Nick Zadrozny

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to