Domain alias redirecting 4 domains to one


#1

Is there a way I can have four domains, directing users to only one?

example1.com
example2.com
example3.com
example4.com

Where all of them point to the same website, lets say example1.com
I mean, it doesnt matter which domain user types, it redirects to example1.com


#2

I believe you need to point all domains to the IP of your VPS.

After this you could “Park” all domains directly in the nginx.conf in EE v3 or main.conf EE v4 of the exemple1.com (root site)

look for “Server {”

Server {
    server_name exemple1.com www.exemple2.com www.exemple3.com www.exemple4.com
}

Maybe something like that, I’m not an expert, but it might solve it.


#3

Perfect, worked like a charm, just two little corrections:

I am using v4 and the file to edit is at folder: /var/lib/docker/volumes/global-nginx-proxy_confd/_data/

Also, the file name is: default.conf


#4

A new problem arised.

It works, but only until I create another website, because when I do it rewrites default.conf and deletes all customizations.

So the question now is: should I make the customization else where, ou even, how can I make it last a new website inclusion?


#5

I believe that is precisely why this configuration should be done in the Nginx file of the domain in question, if you do in the original file of Nginx when you update lose the settings.

I have a problem similar to multisite WordPress, in which mapped domains do not work.

The @kirtan shared this that I did not know https://github.com/EasyEngine/feature-requests/issues/23 not sure if it works because it still does not test, but as it is a “Alias” may be that works.


#6

Ignoire, i just tested

Error: Parameter errors:
 unknown --alias parameter

#7

Now I get this:

503 Service Temporarily Unavailable
nginx

If I access through http, while if I try through https, it simply redirects to the first website I have created, which is not example1.com, so an even worse problem


#8

Create a new conf file in the same folder. Name it however you want as long as it ends in conf. Nginx will pull all conf files from this folder.


#9

Did it, but no lucky, it simply ignores it