0

So I currently have a proxy configuration that looks like the following:

ProxyPassMatch ^/foo/bar/(.+)$ https://xyz.domain.net/$1
ProxyPassReverse ^/foo/bar/(.+)$ https://xyz.domain.net/$1

ProxyPreserveHost Off

I'm trying to map, for example, https://my.website.com/foo/bar/home to https://xyz.domain.net/home.

The proxypass seems to be working as I can see the webpage from xyz.domain.net/home, however the webpage is the ONLY thing that seems to be being proxied. All other assets such as js files or fonts are not being correctly requested.

For example, when loading https://xyz.domain.net/home this page fetches https://xyz.domain.net/scripts/index.js. However, when accessing it via the proxy URL https://my.website.com/foo/bar/home the asset is instead attempted to be retrieved from https://my.website.com/scripts/index.js and of course is responded with a 404.

Is there any other proxy directive which I must include in order for the assets loaded by the page to also be retrieved from the xyz.domain server?

As another piece of information, I've attempted ProxyPreserveHost On instead of Off but this retrieves a 403 from the end server on every page I try to access to.

I am using Oracle HTTP Server version 12.2.1.4

Thank you in advance.

Ress
  • 45
  • 1
  • 2
  • 8
  • Does this answer your question? [How can I forward requests from my web server?](https://serverfault.com/questions/1035016/how-can-i-forward-requests-from-my-web-server) – Gerald Schneider Feb 20 '23 at 14:05
  • See the section `Backend configuration` – Gerald Schneider Feb 20 '23 at 14:05
  • Hi Gerald. Which part of that section do you mean exactly? I should mention that I don't have access to the xyz server configurations – Ress Feb 20 '23 at 14:18
  • I will edit my post, but I should have been clearer, I am using OHS rather than Apache. Both `ProxyHTMLURLMap` `ProxyHTMLExtended` keywords aren't accepted. The rest of the configuration seems to be exactly as described there – Ress Feb 20 '23 at 17:09
  • You need the `mod_proxy_html` module for that. If that is not available configuring the backend with the correct URLs is the only way. – Gerald Schneider Feb 21 '23 at 05:55
  • Hi Gerald. We have been able to install mod_proxy_html on the apache and load the module on httpd.conf. Is it possible to just modify the relativate path of the html using this module, just for everything after the `^/foo/bar/(.*)$` endpoints? – Ress Feb 22 '23 at 13:40
  • From reading the documentation of the module I would assume yes. – Gerald Schneider Feb 22 '23 at 13:43
  • I have attempted `ProxyHTMLURLMap https://example.com/(.*)$ ^/foo/bar/$1 R` but unfortunately when the proxied page is loaded it's still trying to retrieve the assets from the `^/foo/bar` server – Ress Feb 22 '23 at 14:06

0 Answers0