httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudeep Pandey <sudeep.pande...@gmail.com>
Subject [users@httpd] Apache Web Server Rewrite rule
Date Wed, 26 Sep 2012 17:19:28 GMT
Hi Experts,


Really need your help to resolve an issue. In our case, F5 Load balancer is
forwarding http requests to Apache Web Server at 9080. We have an existing
rewrite rule as below.


NameVirtualHost *:9043
<VirtualHost *:9043>
        SSLEngine on


        SSLCertificateFile
/local/isign/apachewebserver/httpd242/conf/isigndev-2048.crt
        SSLCertificateKeyFile
/local/isign/apachewebserver/httpd242/conf/isigndev.key


        ProxyRequests Off
        ProxyPreserveHost On
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
        ProxyPass               /iSign ajp://127.0.0.1:8009/iSign
        ProxyPassReverse        /iSign ajp://127.0.0.1:8009/iSign
        ProxyPass               /MSBPlugIn ajp://127.0.0.1:8009/MSBPlugIn
        ProxyPassReverse        /MSBPlugIn ajp://127.0.0.1:8009/MSBPlugIn
ProxyPass / ajp://127.0.0.1:8009/iSign/index.html
ProxyPassReverse / ajp://127.0.0.1:8009/iSign/index.html
        ServerName isign-dev.gsk.com
</VirtualHost>


<VirtualHost *:9080>
RewriteEngine On
RewriteCOND %{https} !=on [NC]
RewriteRule     ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
ServerName isign-dev.gsk.com
</VirtualHost>


The above rule works fine when requests coming on 9080 port then
1. Convert http://isign.abc.com/iSign/.... to
https://isign.abc.com/iSign......
It works fine because the URL does not contain Port number.
2. It breaks when http requests url string includes the IP:Port and not
just the Domain name. In the below example, the URL http://IP:9080/iSign/...
gets converted to https://IP:9080/iSign/...But AWS https port in our case
is configured to 9083 .


Can anyone help me rewrite rule based on my below requirements :


If request coming on 9080 port then
1. Convert string http://isign.abc.com/iSign/.... to
https://isign.abc.com/iSign......
That is, simply convert http to https.
2. Convert string http://IP:9080/iSign/... to https://IP:9083/iSign/.....


Your help on this is greatly appreciated.


Thanks,
Sudeep Pandey

Mime
View raw message