1

I have one server with nginx-frontend and apache-backend.

I need to set up nginx to return images from the other two servers like

http://example.com/images/*.jpg -> http://i1.example.com/images/*.jpg
http://example.com/images/*.jpg -> http://i2.example.com/images/*.jpg 

image folder is the same on both servers.

earlier I asked this question and get answer to put

 
upstream backend { 
    server i1.example.com;
    server i2.example.com;
}

location /images/ { proxy_pass http://backend/; #rest of config }

in my config. It work.

but I need some other solution, need to see i1.example.com and i2.example.com in headers,now I see only example.com header. Is it possible?
I would be grateful for any advice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.