Can I have two domains pointing towards the same IP address without redirect?

I have to different domains registered in godaddy. i have created an A record for both pointing towards the IP address of my digital ocean droplet, however, one of the domains is just redirecting to the other. i want to be able to access my message board with either domain - without redirecting. is this possible? what do i need to do?

Discourse won’t load properly on the 2nd domain even if you manage to get past the redirect.

What is the use case here? Why do you want to different domains to point to the same discourse as if it is a unique installation?

If you want two domains to both point to the same Discourse forum, it’s not possible – there must be a single official hostname.

If you want to run two Discourse instances on the same server, there are multiple ways to accomplish that.

3 Likes

It’s possible for me, although hacky. Don’t blame me if it breaks something for you. A site specific (non-generic) plugin was created:
GitHub - mig5/discourse-whonix-onion-host-support: load Whonix site on onion if used

Appreciate comments.

That plugin does “most” (can’t quantify) of the work. For the rest I am using nginx subs_filter.

Though, CSP on secondary domain is getting into the way.


My use case: providing a secondary .onion domain. Quote

Onion Location

Website publishers now can advertise their onion service to Tor users by adding an HTTP header. When visiting a website that has both an .onion address and Onion Location enabled via Tor Browser, users will be prompted about the onion service version of the site and will be asked to opt-in to upgrade to the onion service on their first use.

If you are a developer, learn how to enable onion-location in your onion service.


Another cool use case is alt-svc (related to cloudflare onion).

.onion is also useful for non-location hidden, public servers. It’s an alternative means of end-to-end (or Tor to Tor) encryption that doesn’t rely on SSL/TLS certificate authorities. Onions can also be made fast using server side using HiddenServiceNonAnonymousMode 1, HiddenServiceSingleHopMode 1 and client side using Tor2Web mode (single hop).

Good point but not worried about this. The secondary domain name (in my case .onion) could use HTTP header X-Robots-Tag: noindex.

Related:
Forcing hostname has broken support for Onion Services

Potential duplicate:
How to add a second domain name?