force all to https

114 views
Skip to first unread message

Tim Clarke

unread,
Nov 18, 2015, 6:48:03 PM11/18/15
to Lucee
I can't work out in the stack of apache/tomcat/lucee how to compulsorily force https use.

I've currently only got this in my apache virtualhost 80 configuration:

Redirect permanent "/" "https://mysite.com/"

but its not working :/

Am I putting this in the right layer of the cake?

Would this approach work better:

            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
            RewriteRule ^(.*)$ https://mysite.com$1 [L,R=301]

or should I just go and ask in an apache forum. Ah me. To bed.

Jon Clausen

unread,
Nov 18, 2015, 6:56:44 PM11/18/15
to lu...@googlegroups.com

What’s the virtual host block look like in Apache. That should work:

<VirtualHost *:80>
   ServerName mysite.com
   ServerAlias *.mysite.com

   Redirect permanent / https://mysite.com/

</VirtualHost>

Is there a conflicting host name or default server that’s overriding?

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/6ff9afed-32b4-4c8d-a077-0f01e1911b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Clarke

unread,
Nov 19, 2015, 6:42:34 AM11/19/15
to Lucee
That's what I have, I think. After some fiddling those two sites demo and main work OK with this:

<VirtualHost *:80>
  ServerName demomysite.com

  Redirect permanent / https://mysite.com/
  <Location />
    ProxyPass        http://demomysite.com:8888/
    ProxyPassReverse http://demomysite.com:8888/
  </Location>
</VirtualHost>

<VirtualHost *:443>
  ServerName demo.mysite.com

  Redirect permanent / https://mysite.com/
  (ssl config lines....)
  <Location />
    ProxyPass        https://demomysite.com:8888/
    ProxyPassReverse https://demomysite.com:8888/
  </Location>
</VirtualHost>

<VirtualHost _default_:80>
  ServerName mysite.com

  Redirect permanent / https://mysite.com/
  <Location />
    ProxyPass        http://mysite.com:8888/
    ProxyPassReverse http://mysite.com:8888/
  </Location>
</VirtualHost>

<VirtualHost _default_:443>
  ServerName mysite.com

  Redirect permanent / https://mysite.com/
  (ssl config lines....)
  <Location />
    ProxyPass        https://mysite.com:8888/
    ProxyPassReverse https://mysite.com:8888/
  </Location>
</VirtualHost>

but if I go to the IP address for the server I get the Lucee welcome page now despite those _default_ entries :(

Jon Clausen

unread,
Nov 19, 2015, 7:00:40 AM11/19/15
to lu...@googlegroups.com
Your last VirtualHost block, the default SSL, is configured to endlessly redirect.  You shouldn't have a RedirectPermanent directive there.

If you're getting the Lucee welcome page after you change that, then there's likely an issue with your Tomcat host config directory for the site (or you have a rewrite rule in place that is unable to resolve.)
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Tim Clarke

unread,
Nov 19, 2015, 7:03:52 AM11/19/15
to Lucee


On Thursday, 19 November 2015 12:00:40 UTC, Jon Clausen wrote:
Your last VirtualHost block, the default SSL, is configured to endlessly redirect.  You shouldn't have a RedirectPermanent directive there.

If you're getting the Lucee welcome page after you change that, then there's likely an issue with your Tomcat host config directory for the site (or you have a rewrite rule in place that is unable to resolve.)

Sorry - cut-and-paste fail - that last RedirectPermanent is not there.
Reply all
Reply to author
Forward
0 new messages