There is a problem. Some pictures exist on the local server, and some exist on third-party servers.
And the picture names are similar ~ it’s hard to distinguish ~
So I want to configure a proxy. If it can’t be found on the local server, proxy it to the third-party server. Third-party server.
How to configure this nginx?
Final solution:
<code>location /{ root xxxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyy; } }</code>
There is a problem. Some pictures exist on the local server, and some exist on third-party servers.
And the picture names are similar ~ it’s hard to distinguish ~
So I want to configure a proxy. If it can’t be found on the local server, proxy it to the third-party server. Third-party server.
How to configure this nginx?
Final solution:
<code>location /{ root xxxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyy; } }</code>
Error redirect
location /{
<code>error_page 404 @test;</code>
}
location @test{
<code>proxy_pass http://upstreamName;</code>
}
Finally solved this~
<code>location /{ root xxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyyyyy; } }</code>