Reverse Proxy, mod_proxy_html. How to rewrite JS-generated relative links?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

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

------------------------------------------
<html>
  <body>
    <a href="">   </body>
</html>
------------------------------------------

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

/foo/x.html

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

------------------------------------------
<html>
  <head>
    <script>
      function makeLink(){
        var node = document.getElementById("foo");
        node.href = "">        node.innerHTML = "link";
      }
    </script>
  </head>

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

</html>
------------------------------------------

The link is not rewritten, and the GET request to

www.example.com/x.html

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.

Regards,
Giovanni

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux