Reverse proxy with URLs replacement
Jose David Bravo A
jbravo at colombiahosting.com.co
Sat Jun 17 15:25:25 UTC 2023
Hello,
Is it possible to use Nginx as a proxy for another website, while also having the ability to replace absolute paths in CSS, JS, and HTML content?
For example, I would like to have an Nginx server running at the URL http://proxy1-server.com that proxies a web server running at the URL http://192.168.10.10 (private IP). The web server could be any server such as Apache, LiteSpeed, IIS, etc. I can achieve this using an Nginx reverse proxy, but I would also like to rewrite the absolute URLs within the CSS, JS, and HTML files from http://192.168.10.10/file.css to http://proxy1-server.com/file.css, in order to avoid any functionality issues when accessing the website from outside the network.
The idea is to replace these URLs within the proxy server itself, rather than modifying the web server where the website is hosted.
Thank you!
Jose David Bravo Álvarez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20230617/51490854/attachment.htm>
More information about the nginx
mailing list