而且图片名称都类似~不好区分~
因此我想配个代理.如果在本地服务器找不到,就代理到第三方服务器.
请问这个nginx 如何配置?
最终解决方法:
location /{ root xxxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyy; } }
回复内容: 有个问题.有的图片存在本地服务器,有的存在第三方服务器.
而且图片名称都类似~不好区分~
因此我想配个代理.如果在本地服务器找不到,就代理到第三方服务器.
请问这个nginx 如何配置?
最终解决方法:
location /{ root xxxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyy; } }
错误重定向
location /{
error_page 404 @test;
}
location @test{
proxy_pass http://upstreamname;
}
最终这么解决的~
location /{ root xxxx; index index.html; if (!-e $request_filename) { proxy_pass yyyyyyyyy; } }
