Create an alias domain with port forwarding

What is the name of the domain?

example

What is the error number?

520

What is the issue you’re encountering

Alias/Redirect for two domains, ssl certificates

What steps have you taken to resolve the issue?

I have a main domain api.main that uses a Cloudflare load balancer. Since I have multiple applications, I need something that forwards api.alias to api.main with a different port. So I created a CNAME record from api.alias to api.main (without proxy, but with Cloudflare rule to change port). It worked fine with HTTP, but now I have enabled HTTPS and HSTS on both and configured an Origin Server certificate with Authenticated Origin Pulls (via hostname on api.main) between api.main.de and my backend server. Everything works fine on api.main, but I get an error on api.alias. Does the SSL certificate of api.main also have to include api.alias? Or should I activate the proxy for api.alias? Or should I redirect api.alias instead of a CNAME entry? Performance is important to me, so I am looking for a fast solution with little overhead. This is not directly related to the topic, but does cloudflare recognize that the two domains are both on Cloudflare? Or are they considered “separate”?

What feature, service or problem is this related to?

I don’t know

How’s your origin host, the config file, vhost, setup for your alias? :thinking:
Which web server are you using?

May I ask if you are still experiencing such issue?

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.