How to host a secondary website on a subdomain?

So I'm hosting a website www.example.com on port 80 and that is working fine. I am hosting another website on port 443. How would I go about creating a DNS record, test.example.com, for the website hosted on port 443?
20 Replies
Idle
Idle2mo ago
:confusedpixeljoe: you add the record
Constantly
ConstantlyOP2mo ago
I tried that it always redirects to the main website running on port 80
Idle
Idle2mo ago
that's... not how subdomains work
Constantly
ConstantlyOP2mo ago
What record do I add then?
Idle
Idle2mo ago
the same type that you use for www.example.com
Constantly
ConstantlyOP2mo ago
I'm using an A record, but whenever I tried to add an A record for test.example.com for the port 443 but it always redirects to www.example.com and port 80
Idle
Idle2mo ago
then something is redirecting
Constantly
ConstantlyOP2mo ago
I know that but how do I get it to redirect to the correct port
Idle
Idle2mo ago
Port 80 is for http traffic, 443 for https... this setup alone sounds... unconventional i would highly recommend you use something like nginx to route requests based on hostname Alternatively you can create a origin rule to redirect traffic to a specific port by hostname :shrugpepe:
Constantly
ConstantlyOP2mo ago
I'm trying to host a maven repo at a different port that the main webserver but any port that I choose it always redirects traffic to the main webserver at port 80
Idle
Idle2mo ago
ye once again, redirects don't happen on their own
Constantly
ConstantlyOP2mo ago
I chose port 443 because it was already forwarded on the host server well then how do I get it to redirect to a different port?
Idle
Idle2mo ago
. not sure if this is available for all plans
Constantly
ConstantlyOP2mo ago
I tried to create a origin rule but it comes up with error 1016
Constantly
ConstantlyOP2mo ago
No description
Constantly
ConstantlyOP2mo ago
I created the A record for the subdomain but it's still redirecting to the main domain
WTDawson9
WTDawson92mo ago
Is it on the same server?
Constantly
ConstantlyOP2mo ago
yeah
WTDawson9
WTDawson92mo ago
Use something like NGINX with a reverse proxy then Basically, you tell two servers to listen on port 80, but set the actual like web servers to listen internally on different ports (e.g. 150 and 151) and then you use NGINX with a reverse proxy to listen on port 80 twice but on different server names
Constantly
ConstantlyOP2mo ago
okay that kind of makes sense thank you
Want results from more Discord servers?
Add your server