Apache – Substitute URL with Mod Proxy

apache-2.4mod-proxyreverse-proxy

I have configured a new vhost on apache 2.4 and when I tested the configuration all work fine but only one page is not redirected correctly.
the call to the images is done by images.html page :

 <ag-iframe agfa-testid="textImageFrame" class="image" reserve-height='{"desktop": 150, "mobile": 200}'
           ng-src="{{viewerUrl}}" onload="onLoad()" force-resize="true">
</ag-iframe>

the received code in the browser is like this :

<div class="image ng-scope" style="height: 172px;" onload="onLoad()" 
agfa-testid="textImageFrame" src="https://localserver:9251/share/collab?collabSession=263be97d-f16d-491a-a471-bb370a6d9683&amp;type=join&amp;user=username&amp;isInitiator=true" 
    ng-src="https://localserver:9251/share/collab?collabSession=263be97d-f16d-491a-a471-bb370a6d9683&amp;type=join&amp;user=username&amp;isInitiator=true" reserve-height='{"desktop": 150, "mobile": 200}' force-resize="true">
    <iframe id="agIframe" src="https://localserver:9251/share/collab?collabSession=263be97d-f16d-491a-a471-bb370a6d9683&amp;type=join&amp;user=username&amp;isInitiator=true" style="width: 100%; height: 100%" ng-src="https://localserver:9251/share/collab?collabSession=263be97d-f16d-491a-a471-bb370a6d9683&amp;type=join&amp;user=username&amp;isInitiator=true">
</iframe>
</div>

are there any chance to change all localserver in the response to publicnameserver with substitute, ProxyHTMLURLMap or other mod and proxypass the new url???

I have tryed this :

 ProxyHTMLURLMap url(localserver:9251([^)]*)) url(publicnameserver:9251$1) Rihe

but in the logs I have this error :

(Non-HTML content; not inserting proxy-html filter,
referer:publicservername/mobile)

may be I have missed some config???

Best Answer

the correct code is :

AddOutputFilterByType SUBSTITUTE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json
Substitute "s|https:\/\/localserver:9251|https:\/\/publicnameserver:9251|ni"

with mod substitute I have replaced the localserver with publicnameserver.

thanks for your help.

Related Topic