Our site is a repository of images. Each image has the concept of an external URL and an internal URL. Customers see the external URL and they change when we experiment with SEO. An internal URL is a permanent URL that points to our image hosting service. We use our Ruby on Rails application to provide URL translation. Here is an example request:
-------- ----- ------- ------- ------------ | | --eURL--> | | --> | | --> | | -iURL--> | | |client| |CDN| |Nginx| | RoR | |Image Host| | | <-------- | | <-- | | <-- | | <-IMG--- | | -------- ----- ------- ------- ------------
The architecture works, but image streaming through RoR is inefficient. I want Nginx to proxy. What is this for. The proposed architecture will look something like this:
-------- ----- ------- ------- | | --eURL--> | | --> | | ------> | RoR | |client| |CDN| |Nginx| <-????- | | | | <-------- | | <-- | | ------- -------- ----- | | ------------ | | -iURL-> |Image Host| | | <-IMG-- | | ------- ------------
What answer can I send to Nginx to get proxy data? I am not opposed to adding Nginx modules to my infrastructure, and, of course, I am open to modifying my nginx.conf.
X-Sendfile is the closest thing I found, but it only allows streaming from the local file system. Maybe there is another obscure HTTP response header or status code that I don't know about.
source share