Reverse proxy with URLs replacement

Reinis Rozitis r at roze.lv
Mon Jun 19 06:25:16 UTC 2023


> 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?

One way for that is to use proxy http://nginx.org/en/docs/http/ngx_http_proxy_module.html + sub module http://nginx.org/en/docs/http/ngx_http_sub_module.html 

The only caveat is that the sub module doesn't support compressed responses from backends so you need to switch it off by setting proxy_set_header Accept-Encoding "";

rr


More information about the nginx mailing list