Score:-1

How to map a subdomain to a specific port on the server?

gl flag

I have a server that has a docker container running on port 443 (registry), which I access by addressing https://registry.mywebsite.com. I want to also direct https://pages.mywebsite.com to that server, though port 443 is already used by the registry. How can I serve https://pages.mywebsite.com from that same server?

Score:0
cn flag

Not at all. See, DNS does not care about ports (outside of some entries like SVR, which are NOT used for web). It maps domain names to IP addresses. No ports involved. And yes, HTTP is not using SRV records to start with.

But multiple websites on one port - even with HTTPS - is a solved problem for many years, so I suggest you... read the manual for your web server how to do that.

naraghi avatar
gl flag
If I was using nginx on port 443, I would know where to read up on this, but the problem is that I have a totally unrelated docker container listening on port 443.
cn flag
Nope, you then use a reverse proxy to distribute traffic. You can use Ngix to forward traffic for a domain from 443 to your container running on another - non internet open - port.
naraghi avatar
gl flag
Thanks a lot, I understand now.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.