2

let me explain my question with an example:

I want to point the url:

    https://www.example.com to Server A (IP aaa.bbb.ccc.ddd)

and

    http://www.example.com to Server B (IP eee.fff.ggg.hhh)

Is that possible? And if yes, how do you do this? How do you set the DNS for this?

(I am on apache, w/ cpanel)

Thanks

3 Answers 3

8

You can't do this with DNS. You'd have to put a proxy or NAT boundary in front of it that has this capability.

2
  • A NAT would also work instead of a proxy.
    – Zoredache
    May 10, 2012 at 17:06
  • Yep, good point.
    – MDMarra
    May 10, 2012 at 17:38
3

This is impossible, but you have two workarouds:

a) set up a proxy on www.example.com, and use different servers for http and https traffic (all traffic still goes through proxy)

b) use another domain for https (ssl.example.com or something like that)

There is no was to have the same domain point to different servers depending on the protocol used to connect.

3

you need to use a load balancer with its dns record at www.example.com to forward different traffic to different backend servers based on the requesting port. if you don't have a hardware lb, you can use something in software such as haproxy.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .