[users@httpd] Switching between HTTP and HTTPS using Rewrite Module, where Mod Proxy used for other purpose.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I am trying to Switch protocol between HTTP and HTTPS using Rewrite Module. Little background before I start problem. I use Apache as web sever(on 182.24.116.157)  and Weblogic(on 182.24.226.59)  as application sever. So all my code deployed in weblogic server. Apache simply redirects the request. I access site as http://182.24.116.157:7333/godzilla/ where “godzilla” is name of deployed .war file in weblogic To enable switching between HTTP and HTTPS I used below rewrite rule but this isn’t working. I want to redirect all the pages which start with “isc” on to HTTPS for example below

http://182.24.116.157:7333/godzilla/iscmypage should be rewritten as https://182.24.116.157:7334/godzilla/iscmypage

 

For HTTP Virtual Host

RewriteEngine on

RewriteRule ^/godzilla$ http://182.24.116.157:7333/godzilla/     # Here also tried ^godzilla$

RewriteRule ^/godzilla/(isc\.*)$ https://182.24.116.157:7334/godzilla/$1 [L] # Here also tried removed preceding /

RewriteRule ^/godzilla/(.*)$ http://182.24.116.157:7333/godzilla/$1 [P,L] # Here also tried removed preceding /

 

and for the SSL virtual host config:

 

RewriteEngine on

RewriteRule ^/godzilla/(isc\.*) http://182.24.116.157:7333/godzilla/$1 [P,L]          # Here also tried removed preceding /

RewriteRule ^/godzilla$ http://182.24.116.157:7333/godzilla/               # Here also tried removed preceding /

RewriteRule ^/godzilla/(.*) http://182.24.116.157:7333/godzilla/$1 [L]               # Here also tried removed preceding /

 

Its doesn’t work out, Your Help will be much appreciated.

 

Thanks & Regards

 

PS: For reference I had pasted below Apache Virtual host entries.

 

 

# Below virtual host for HTTPS/SSL:

NameVirtualHost 182.24.116.157:7334

SSLMutex default

SSLRandomSeed startup builtin

SSLSessionCache none

<VirtualHost 182.24.116.157:7334>

SSLEngine On

SSLCertificateFile "/data2/godzillaapp/apache/apache1/conf/ssl/182.24.116.157.cert"

SSLCertificateKeyFile "/data2/godzillaapp/apache/apache1/conf/ssl/182.24.116.157.key"

# Proceed with  your proxy and server settings here.

    ServerAdmin webmaster@xxxxxxxxxxxxxxxxxxxxxx

    DocumentRoot /data2/godzillaapp/apache/apache1/htdocs

    ServerName 182.24.116.157

RewriteEngine on

RewriteRule ^/godzilla/(Isc\.*) http://182.24.116.157:7333/godzilla/$1 [P,L]          # Here also tried removed preceding /

RewriteRule ^/godzilla$ http://182.24.116.157:7333/godzilla/               # Here also tried removed preceding /

RewriteRule ^/godzilla/(.*) http://182.24.116.157:7333/godzilla/$1 [L]               # Here also tried removed preceding /

<IfModule mod_proxy.c>

ProxyRequests off

 <Proxy *>

 order deny,allow

 Allow from all

 </Proxy>

 ProxyBadHeader Ignore

 Alias /godzilla/ "/data2/godzillaapp/apache/apache1/htdocs/"

 Alias /godzilla "/data2/godzillaapp/apache/apache1/htdocs/"

 ProxyPass       /godzilla/ http://182.24.226.59:7001/godzilla/

 ProxyPassReverse        /godzilla/ http://182.24.226.59:7001/godzilla/

</IfModule>

</VirtualHost>

 

# Below virtual host for HTTP:

NameVirtualHost 182.24.116.157:7333

<VirtualHost 182.24.116.157:7333>

RewriteEngine on

RewriteRule ^/godzilla$ http://182.24.116.157:7333/godzilla/     # Here also tried ^godzilla$

RewriteRule ^/godzilla/(Isc\.*)$ https://182.24.116.157:7334/godzilla/$1 [L] # Here also tried removed preceding /

RewriteRule ^/godzilla/(.*)$ http://182.24.116.157:7333/godzilla/$1 [P,L] # Here also tried removed preceding /

    ServerAdmin webmaster@xxxxxxxxxxxxxxxxxxxxxx

    DocumentRoot /data2/godzillaapp/apache/apache1/htdocs

    ServerName 182.24.116.157

<IfModule mod_proxy.c>

ProxyRequests off

 <Proxy *>

 order deny,allow

 Allow from all

 </Proxy>

 ProxyBadHeader Ignore

 Alias /godzilla/ "/data2/godzillaapp/apache/apache1/htdocs/"

 Alias /godzilla "/data2/godzillaapp/apache/apache1/htdocs/"

 ProxyPass       /godzilla/ http://182.24.226.59:7001/godzilla/

 ProxyPassReverse        /godzilla/ http://182.24.226.59:7001/godzilla/

</IfModule>

</VirtualHost>

 

 

 

============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.


Disclaimer:


The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Tech Mahindra.


This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and Tech Mahindra is not responsible for any loss or damage arising in any way from its use.

============================================================================================================================

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux