Excuse my ignorance on this topic but I wonder if it would be possible to direct incoming traffic based on CNAMEs, if at all possible. To clarify what I mean as I may be using the wrong terminology I have a domain we can call mydomain.com. To this domain I have several subdomains like cloud.mydomain.com. Today I use an nginx reverse proxy on one host (host 1) to direct traffic addressed to lets say cloud.mydomain.com to the right host (host 2) in within my network and another host may be on wiki.mydomain.com (host 3) etc. For this I use port forwarding (PAT) to direct ports 80 and 443 to host 1. My question is if it would be possible already in the router to detect the CNAME e.g. cloud.mydomain.com and send this traffic straight to the right host without the use of my reverse proxy.
Not really no. The router looks at IP packets which have addresses not names
On HTTP, the client first resolves the name to an IP address, connects to that IP address, and then asks for content using the name again.
The first step is what allows you to have two names on the same IP, and the third one is how you serve two names on the same IP.
You are now asking about the second step, but on this step it's all about an IP address, there are no names involved.
Thanks for the explanation, it makes sence. Then I guess I'm stuck with my reverse proxy.