I have a server which is running a bunch of docker images (which basically just host a bunch of websites)
they all have different domain names all pointing to the server's IP
(lets say the server IP is 111.222.333.444)
(and my domains are www.one.com, www.two.com, www.three.com)
At the moment, the docker images all export port 80 to the server on a different port:
- www.one.com is port 5080
- www.two.com is port 5180
- www.three.com is port 5280
So if I visit the URL:port then the website shows up.
But I want to use a virtual host so I can visit port 80 on every URL and it just redirect to the relevant port.
I know how to do this with apache, and probably could figure it out with nginx.
But I hear this is what squid is really for (plus apache as a virtual host seems like very heavy weight)
I've installed squid3 on my ubuntu12.04 server
and this is my squid.conf so far
http_port 80 accel defaultsite=www.one.com no-vhost
cache_peer 127.0.0.1 parent 5080 0 no-query originserver name=YourAccelNameHere
acl your_site_acl dstdomain www.one.com
http_access allow your_site_acl
cache_peer_access YourAccelNameHere allow your_site_acl
cache_peer_access YourAccelNameHere deny all
From reading a tutorial that "should" forward www.one.com to port 5080 on localhost (but it isn't)
I really have no idea about squid and from all my googling I cant seem to find a simple tutorial to do what I want.
Can anyone point me to a good tutorial or even better provide me a squid.conf that would do what I'm after?
Thanks
Best Answer
Answered it myself
My solution is:
I solved it with varnish
Then I set my
to
Then set my
to
I hope that can help someone else facing this problem!