How do I compel Apache to make use of HTTPS combined with AJP?

We have an Apache internet site, with particular sections powered by JBoss. The inquiry is, just how can we get Apache to compel all HTTP demands to be re - routed to the HTTPS matching?

On our old server (CentOS 4, Apache 2.0, mod_jk), we have the adhering to arrangement:

<VirtualHost 1.2.3.4:80>
Redirect / https://www.foo.com/
</VirtualHost>

This functions wonderful - - any kind of demands to a PHP, vanilla HTML, or JBoss - powered website get re - routed. Nonetheless, on our new server (CentOS 5, Apache 2.2, mod_proxy_ajp), the very same arrangement just benefits vanilla web pages - - except anything being sent out to JBoss making use of AJP.

I additionally attempted the adhering to, which I located at http://www.webmasterworld.com/apache/3050511.htm:

<Proxy *>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</Proxy>

But still no good luck. I seem like I'm missing out on something noticeable. Any kind of aid?

P.S. I am never an Apache specialist. I ask forgiveness if this becomes a newbie inquiry: - P.

0
2019-05-18 20:35:24
Source Share
Answers: 2

However you address it, can I recommend placing the instruction SSLRequireSSL in the areas you intend to be SSL just. In this way if there is a config mistake later on while doing so, absolutely nothing is revealed over a non - SSL link.

0
2019-05-21 06:38:40
Source

If I recognize you appropriately, you intend to update all http demands to https. If this is proper shot this

<VirtualHost ip:80>
   ServerName www.company.com

   RedirectMatch permanent ^(.*)$ https://www.company.com$1
</VirtualHost>

<VirtualHost ip:443>
   ServerName www.company.com

   Include vhosts.d/includes/ssl.conf

   # assumes you want to proxy everything on this vhost to jboss:8009
   <Location / >
       ProxyPass ajp://jboss:8009/
   </Location>
</Location>
0
2019-05-21 06:13:36
Source