Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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)


    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)


share|improve this question

3 Answers 3

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.

share|improve this answer
A NAT would also work instead of a proxy. –  Zoredache May 10 '12 at 17:06
Yep, good point. –  MDMarra May 10 '12 at 17:38

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.