httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giovanni Gherdovich <>
Subject [users@httpd] Reverse Proxy, mod_proxy_html. How to rewrite JS-generated relative links?
Date Sun, 17 Nov 2013 17:02:46 GMT

I successfully configured mod_proxy_html to rewrite
relative URLs like the one in this document:

    <a href="/x.html">link</a>

If I serve the above document from a private network
via reverse proxying with Apache on my "frontend server"
at and want that the "document root"
of all pages I serve from the backend is "foo",
as in , the link in the above doc is
correctly rewritten to


But what if the link is generated via a Javascript program
directly in the user's browser, like the following:

      function makeLink(){
        var node = document.getElementById("foo");
        node.href = "/x.html";
        node.innerHTML = "link";

  <body onload="makeLink();">
    <a id="foo"></a>


The link is not rewritten, and the GET request to

ends up with a sad 404.

>From the (very limited) knowledge I have about web stuff,
I don't see any way my frontend server can inject the right
link in that HTML page;

I'd like to know how do people usually handle this situation.


View raw message