View Full Version : SSL and Apache http - https
andy_hollywood
Aug 5th, 2010, 04:30 AM
Morning, I got my app deployed and the relevant SSL keys all working, nice job. just wondering how I would go about forcing all http connections to go to https.
I can see the apache directives box, but wondering what i can put in there on one line that will work, or can they be seperated out with a ;?
Cheers
Andy
jamestastic
Aug 5th, 2010, 09:30 AM
If you're using Apache HTTP Server, you can use the RewriteRule directive:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://myhostname/$1 [L,R=301]
This will cause an HTTP 301 redirect to HTTPS.
See here (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html) for more information.
andy_hollywood
Aug 5th, 2010, 09:37 AM
ok, so i get that bit, looks sensible, the question was more specificially how do i use the cloud foundry UI to enter multiline additions to the http.conf file?
pabrari
Sep 29th, 2010, 05:17 PM
I'm trying to disable HTTP access to my application and only allow HTTPS access. I tried to use the RewriteRule as suggested but it doesn't have an effect. I have an elastic IP address for my instance and have a godaddy security certificate. I'm using tcServer. Any advice would be appreciated. I've also tried:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
jamestastic
Sep 29th, 2010, 06:42 PM
I'm trying to disable HTTP access to my application
Do you want to simply disable the HTTP service and use only the HTTPS service, or do you want to keep port 80 available so it can redirect to 443?
pabrari
Sep 29th, 2010, 09:26 PM
Ideally a redirect. But would be happy with simply disabling.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.