0

I want my virtualhost "new_target.domain.com" to point via apache reverse proxy to "https://target.com". This works fine but on new_target.domain.com the a hrefs are not correct. They point to https://target.com instead of new_target.domain.com.

"https://target.com/videos/" instead of "https://new_target.domain.com/videos/" or "/videos/"

How is it possible that I remove all the https://target.com references from all URLs so that there only remains "/videos/" in the source files?

Thanks, a lot.

kenlukas
  • 2,886
  • 2
  • 14
  • 25
  • The "problem" is that Apache mod_proxy `proxy_pass_reverse` only rewrite's HTTP protocol headers and not the **HTML** response bodies it receives from the upstream server. To rewrite the HTML pages themselves you need something such as http://httpd.apache.org/docs/2.4/mod/mod_proxy_html.html - See for instance https://serverfault.com/a/634923/37681 for a solution – HBruijn Oct 21 '19 at 13:34
  • I also tried it with ProxyHTMLURLMap, but it also does not work correctly. – user0815 Oct 21 '19 at 13:47
  • This solved my problem: ProxyHTMLEnable On SetOutputFilter INFLATE;proxy-html;DEFLATE ProxyHTMLURLMap / But for medium.com it does not work - they check if the request comes through a reverse proxy – user0815 Oct 22 '19 at 12:22

0 Answers0