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
Idle4w ago
:confusedpixeljoe: you add the record
Constantly
ConstantlyOP4w ago
I tried that it always redirects to the main website running on port 80
Idle
Idle4w ago
that's... not how subdomains work
Constantly
ConstantlyOP4w ago
What record do I add then?
Idle
Idle4w ago
the same type that you use for www.example.com
Constantly
ConstantlyOP4w 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
Idle4w ago
then something is redirecting
Constantly
ConstantlyOP4w ago
I know that but how do I get it to redirect to the correct port
Idle
Idle4w 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
ConstantlyOP4w 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
Idle4w ago
ye once again, redirects don't happen on their own
Constantly
ConstantlyOP4w 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
Idle4w ago
. not sure if this is available for all plans
Constantly
ConstantlyOP4w ago
I tried to create a origin rule but it comes up with error 1016
Constantly
ConstantlyOP4w ago
No description
Constantly
ConstantlyOP4w ago
I created the A record for the subdomain but it's still redirecting to the main domain
WTDawson9
WTDawson94w ago
Is it on the same server?
Constantly
ConstantlyOP4w ago
yeah
WTDawson9
WTDawson94w 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
ConstantlyOP4w ago
okay that kind of makes sense thank you
Want results from more Discord servers?
Add your server