I've been working with NGINX for a little while now but am having trouble solving a particular issue.
I have a set of machines that each run a third-party reporting server. This third-party system puts its web server at the top level of the domain. I can hit it by going to https://reportserver_ip/ only. I can change the port but can not put it in a subdirectory.
I want to use NGINX to reverse proxy to these servers. My goal is to have one domain hit the correct reporting servers based on a subdirectory. Example:
https://mypublicdomain/report1
https://mypublicdomain/report2
https://mypublicdomain/report3
Each would end up reverse proxying to its respective report server.
However, this third-party report server has a number of links that are non-relative.
For example an img with src="\images\..." or a link to javascript at href="\javascripts\..."
Since those links don't have the respective "report1" or "report2" in the url, NGINX doesn't know where to send them.
I can get this working if I reverse proxy to the report servers using different subdomains (report1.mypublicdomain) or different ports (mypublicdomain:XX1) but for different reasons I really need them to all be on the same domain and port.
Is there a way to do this? Can I set it up somehow so that even though the report servers have those non-relative links they will end up proxying to the right place?
If I had control over the third-party reporting tool, I'd just add a base tag to the html head and it would work, but I don't have the ability to do that.
Thanks for help or ideas anyone can provide.
Jeff