logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_substitute not working as expected (or is it?)
Author
laurent.landreau



Joined: 12 Jun 2014
Posts: 2
Location: Sydney, Australia

PostPosted: Tue 01 Sep '15 9:02    Post subject: mod_substitute not working as expected (or is it?) Reply with quote

Hello all,
I am currently deploying an Apache web + Liferay + MySQL and have a problem with the substitute module.
All servers are in different subnets (indicated by '/' below):

F5 + Load-Balancer-External / Apache / LB-Internal + Liferay / DB

In the Apache httpd.conf, I have two separate statements:
1) a proxypass command: when the inbound traffic URL is suffixed with /liferay, I replace the URL with the LB-Internal URL so that the traffic gets forwarded to Liferay. That works fine.
2) a substitute command: when the page contains the LB-internal URL in the outbound traffic coming from Liferay, the substitute module (should) replace the LB-internal string with the URL of the external load balancer.

Problem:
* in the web page sent back to the browser, the LB-Internal URL does not get substituted, meaning the browser gets a URL that it cannot access.

Additional information:
* when I hardcode the exact same set of URLs in an Index.html page served directly by the Apache web server, then the substitution does take place.

Configuration: Apache 2.2.7 on Linux

Substitute directive:
<Location />
AddOutputFilterByType SUBSTITUTE text/html
Substitute s/internal-ELBApp-197711875/ELBWeb-812043423/ni
</Location>
#

I suspect (but I am not sure) that it has to do with how the location statement is used, for Apache based page or for a proxied server.

Am I missing something on through which components the outbound traffic goes through?
Is there something specific in the httpd.conf that I am missing?


Thanks,
Laurent LANDREAU
Oakton - Australia
Back to top
jraute



Joined: 13 Sep 2013
Posts: 188
Location: Rheinland, Germany

PostPosted: Tue 01 Sep '15 9:23    Post subject: Reply with quote

@admin: FYI
This Topic is identical to http://www.apachelounge.com/viewtopic.php?p=31501#31501 just the headline is different.


Last edited by jraute on Tue 01 Sep '15 13:13; edited 1 time in total
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 01 Sep '15 10:03    Post subject: Reply with quote

Thanks for the heads up, removed the other one.
Back to top


Reply to topic   Topic: mod_substitute not working as expected (or is it?) View previous topic :: View next topic
Post new topic   Forum Index -> Apache