国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

How to force nginx rewrite to return 200 status code?
伊謝爾倫
伊謝爾倫 2017-05-16 17:27:56
0
2
835
               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

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無(wú)限,來(lái)學(xué)PHP伐。

reply all(2)
洪濤

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

僅有的幸福
location = /example/path {
    return 200;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template