Home > front end >  Wen Nginx configuration third-party resources agency
Wen Nginx configuration third-party resources agency

Time:09-27

In the front page I use canvas pictures of quoted the third party sites, involves the cross-domain problem, through the Nginx proxy,

The original image to http://other.site/image.jpg
Agent address to http://my.site/3rdparty? Url=http://other.site/image.jpg

Configuration is as follows:
 location ~/3 rdparty {
If ($query_string ~ * ^ (. *) url=(. *) ${
The set $imageUrl $2;
Proxy_pass $imageUrl;
}
}

Original works well, but can't find a picture request today, return a 502 error, but Nginx error. The log without any output,

Third party image is: http://www.dhc.net.cn/goods/6/66_L.jpg
Use browser to function review images, but with the Postman to see is garbled, saved as a file after can see pictures,

How will this Nginx configuration to normal agent? Thank you,
  • Related