In production, do I have to have two domains if I want to use a load balancer with Discourse?

I’m not very well-versed in using load balancers, but this time I really need to use it.

Let’s say my website is called badthreadcomments.com. Every time a user enters my site, their request is sent to my load balancer configured on a VPS, this load balancer should send the request to Discourse hosting in the same VPS, and then Discourse responds to my load balancer, but oh wait, the documentation for using Discourse in production says the following:
“Discourse will not work from an IP address; you must own a domain name such as example.com to proceed.”

The idea is that the load balancer and Discourse are hosted on the same VPS, so communication between my load balancer and Discourse is 100% local, so, if production requires a domain, what am I supposed to do? what’s the plan here? buy a second domain? if a second domain is necessary, wouldn’t that add more latency to the client?

That means that the clients must access Discourse via a domain name. Internally, behind the last customer facing reverse proxy / load balancer you are can do whatever.

1 Like

So the order must be like this?
badthreadcomments.com > Discourse Docker > Load Balancer > Response

Can’t be like this?
badthreadcomments.com > Load Balancer > Discourse Docker > Response

I don’t understand what you mean by “Internally, behind the last customer facing reverse proxy / load balancer you are can do whatever.”

Discourse is not different than any other web application in that regard

graph TD
    User[User]
    LoadBalancer[Load Balancer]
    WebAppCluster[Discourse Web App Cluster, N identical instances]
    Postgres[PostgreSQL]
    Redis[Redis]
    S3[Object Storage]

    User -->|Request| LoadBalancer
    LoadBalancer -->|Distributes requests| WebAppCluster
    WebAppCluster -->|Read/Write| Postgres
    WebAppCluster -->|Cache| Redis
    WebAppCluster -->|Stores static assets| S3
1 Like

I’d recommend checking out Nginx Proxy Manager, the working of that, for your broader understanding.