Say I am trying to proxy all requests coming in for jpg, png and mp3 files like so:
http://example.com/some/url/file.png
to
http://example.net/data/some/url/file.png
Notice it's the exact same path to another server but with data added.
Her's what I have so far:
location ~* .(jpg|png|mp3)$ {
proxy_pass https://example.net/data/;
proxy_redirect https://example.net/data/ /
}
However I keep getting error
"proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block
What is going wrong and how can I correctly write this location block?