Welcome! Log In Create A New Profile

Advanced

Reverse proxy with URLs replacement

Jose David Bravo A
June 17, 2023 11:26AM
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



_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Reverse proxy with URLs replacement

Jose David Bravo A June 17, 2023 11:26AM

RE: Reverse proxy with URLs replacement

Reinis Rozitis June 19, 2023 02:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready