Hi,

I would try this with a location block...

location /URL/of/Picture/tobereplaced.png {
    root /var/www/test1;
    try_files where/stored/image1.png;
}

location / {
    continue to proxy pass everything else

Hope this helps

Ian

On 24/06/2022 00:01, Jason Prouty wrote:
Is it possible to replace an PNG file with a local image
I want to reverse proxy to site and then change the image returned

I have tried the sub_filter setting but nothing changes.


server {
     server_name test1.example1.com;

location /{
     proxy_ssl_server_name on;
     proxy_pass   https://test1.example2.com;
    sub_filter '<img src="https://test1.example2.com/assets/images/image1.png' '<img src="https://test1.example1.com/image1.png';
     sub_filter_once on;
     }

I just want to replace the image of  the proxied https://test1.example2.com <https://test1.example2.com>;<https://esim.jcius.com/assets/images/powered-by-dark.png> https://test1.example2.com/assets/images/image1.png <https://test1.example2.com/assets/images/image1.png>
with
a new image hosted locally on my nginx



_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-le...@nginx.org

--
Ian Hobson
Tel (+66) 626 544 695
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-le...@nginx.org

Reply via email to