I have this url
https://example.com/image/test.jpg
And i would like to proxy with Nginx the image at this url
https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2018/02/google-pacman-796x419.jpg
without the url changing i.e. staying the same as this https://example.com/image/test.jpg
What would you put in the location block to get this to happen?
You can use the proxy_pass
parameter in your nginx config:
server {
# ...
server_name example.com;
# ...
location /image/test.jpg {
proxy_pass https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2018/02/google-pacman-796x419.jpg;
}
}