Page 1 of 1

Accessing the images folder from different server

Posted: Tue Mar 20, 2012 10:24 pm
by jlising
Hi,

I would like to ask if this is possible. I have two hosts,

server1 - web server
server2 - db server

both are in the same vpn. I have a web page in server1 which access the images located in server 2.

example:
<img src="http://server2/images/someimage.jpg">

Is it possible to change the src value to images/someimage.jpg only? What I mean here is the images is physically located at server2 but accessing it like a local folder in server1.

I hope you can suggest a very good setup for this. I don't want to put the ip address of server2 in my scripts.

Regards,
Jess

Re: Accessing the images folder from different server

Posted: Wed Mar 21, 2012 5:09 am
by requinix
Use a proxy: have the /images folder pass requests to server2. In the root .htaccess

Code: Select all

ProxyPass /images http://server2/images
Of course the easiest thing would be to move the images. Is that not an option?

Re: Accessing the images folder from different server

Posted: Wed Mar 21, 2012 5:45 am
by theserve
you could also consider NFS