if (!-e $request_filename){
rewrite "^/maisi/images/(.*)\.jpg" http://img03.taobaocdn.com/.jpg_300x300.jpg last;
rewrite "^/maisi/images/(.*)\.png" http://img03.taobaocdn.com/.png_300x300.jpg last;
}
The above is an nginx image rewrite. In fact, my image is a Taobao image!
This will return 302 Moved Temporarily;
Is there a way to return 200 OK
Because rewrite returns 302, the browser will know that it needs to make another request, and then go to Taobao's cdn to get the image. If 200 is returned, all this will not happen
If you cannot copy the file, you can consider using proxy_pass. In this case, it is equivalent to nginx reading the image from taobao to your server every time, and then your server sends the image to the user, which can return 200 Yes, but the pressure on the server will increase