top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Replacing html body of a page through a reverse proxy?

+1 vote
81 views

I am trying to use filters to replace html body of a page through a reverse proxy. This are my Apache settings :

ServerName myProxy.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined  ProxyRequests Off

Order deny,allow
Allow from all

ExtFilterDefine fixtext mode=output intype=text/html 
cmd="/bin/sed s/aword/replacement/g"
ProxyPass http://mySite.com/ 
ProxyPassReverse http://mySite.com/ 
SetOutputFilter fixtext

If "mysite.come" is on the same server as "myProxy.com" it works but it doesn't work if they are on different servers. What am I doing wrong ?

posted May 29, 2014 by Garima Jain

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

We have a Windows XP machine functioning as a file etc "server" and a Debian Linux machine running
Apache httpd as a web server. We intend to replace the XP machine with some version of Windows Server (looking at WHS 2011 at the moment on a trial basis). I would like to be able to continue running the Apache server, but to allow web access to the WHS machine using apache mod_proxy. I already have this working for several servers (etc. usermin).

I've tried setting this up in my mod_proxy ssl config:

ProxyRequests off
SSLProxyEngine on
ProxyPass /whs/ https://x.x.x.x:443/
ProxyPassReverse /whs/ https://x.x.x.x:443/

When I enter https://mydomain.com/whs/ on an external computer I get "Internet Explorer cannot display the webpage". If I try to access this site within my network my browser redirects to
https://x.x.x.x/Remote/logon?ReturnUrl=%2fremote

Has anyone got this config working, or is there a recipe somewhere for this? I really don't want to use IIS as my primary web server.

+5 votes

WE are trying to setup HTTPS tunnelling to a backend server through Apache proxy but we are finding the client connect but Apache does not send through the traffic the backend server.

Config we have on our Apache proxy virtual host is

DocumentRoot "/usr/local/apache/htdocs/ibcm/" 
ServerName test.testdom.local 
ErrorLog logs/ibcm 
ServerAdmin webmaster@testdom.local 
ProxyRequests On 
AllowConnect 443 
SSLEngine on 
SSLHonorCipherOrder On 
SSLProtocol -ALL SSLv3 TLSv1 
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4RSA:HIGH:MEDIUM 
SSLCertificateFile "/etc/ssl/crt/ibcm.crt" 
SSLCertificateKeyFile "/etc/ssl/crt/testdom.key" 
SSLCertificateChainFile "/etc/ssl/crt/CA-DOM.crt" 
 Order deny,allow 
 Deny from all 
 Order deny,allow 
 Allow from all 

Anybody know what we are not doing correctly. Also we found Apache would not start without us putting in the root certificate. Thought it would not need any certificate for tunnelling so wonder if we have missed something.

+6 votes

I have a reverse proxy (apache 2.2) with mod_proxy_balancer with https visible to the outside world.

The question is: from the proxy performance/scalability point of view is it better to configure backends (origin servers) with http or with https?

Is it true that if proxy is setup https->http then it only has to decrypt/encrypt the headers and the body is encrypted/decrypted on the backend? I do not use mod_proxy_html (but maybe there are other modules which affect this behaviour on the proxy?.

How either setup affects latency of handling requests? With https->https do I have to do two handshakes (on the proxy and on the backend) for every connection? I have KeepAlive both on the proxy and the backends.

+3 votes

I want to expose backend https servers over internet through reverse proxy. Backend servers are already have SSL certificates. Do I need to install SSL on reverse proxy too.

If I redirect external users requests to https server via reverse proxy then will end user see the SSL certificate in browser.

Can anyone help me in this situation. I already have 3 SSL on internal servers, so do I need more certificates. How the configuration will go in this case.

+1 vote

I have an idea how to setup Apache for doing load balancer based on mod_proxy and mod_balance modules. But in my case the backend server requires ssl client certificate authentication and therefore the Apache Server cannot terminate the ssl connection.

I do no need http session cookie stickyness. The application is stateless. Can I somehow configure Apache as a transparent balancer?

Or I should use even another software - squid, iptables? The backend application is a web service running on Tomcat.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...