Need some assistance for setting up a subdomain when there is already a webserver

AI-generated summary

A user is seeking help to set up a subdomain for Discourse on a server where port 80 is already in use. MayusYT initially tries to use a port in the DNS record, but uwe_keim clarifies that DNS only handles IP addresses, not ports. itsbhanusharma suggests using a subdomain instead, and MayusYT confirms this is the goal. itsbhanusharma explains that an A record for the subdomain should point to the server’s IP, and the Nginx proxy should be configured with server_name sub.example.com; to route traffic to the Discourse container. MayusYT thanks them for the solution.

Hi!

I just bought a domain at Namecheap.com.
I have a server with just one IP and I would like to run Discourse on the port 8080 as 80 is already occupied by my website.
When I want to setup an A record for discourse with the port 8080, namecheap says that it’s not a valid IP adress.

Any help is highly appreciated!

Ports are completely out-of-scope in terms of DNS.

DNS maps names to IP addresses.

Port associations is done on your server, not in the DNS.

So what should I use instead in this case?

You’re putting yourself in a very complex territory.

What I can suggest is to run discourse on a subdomain or in a subdirectory.

Yeah, I want to run it on a subdomain! But I don’t know how to tell my nginx proxy that you’re coming from the subdomain.

Create an A Record for sub.example.com with the IP address where You host forum

Then in nginx proxy,

use server_name sub.example.com;
And forward all requests to docker container running discourse.

ooooh! Didn’t think of that! Thank you so much!