Create Alias Server Failing

SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.2
Usermin version 2.202
Virtualmin version 7.30.4
Theme version 23.02
Nginx version 1.24.0
Package updates All installed packages are up to date

Failed to create virtual server : An Nginx virtual host with the same name already exists

But it is NOT listed under Virtualmin -> List Virtual Servers or Webmin -> Servers -> Nginx Webserver

ONLY the parent is (obviously) is this a bug with Nginx?

@Stegan,

You really should provide more verbose information if you expect anyone to actually be able to help with this matter. On the surface the error itself seems self explanitory, however if as you say the domain doesn’t already exist, then please provide more detailed information.

just tried again as a “top level” this time and that has also failed. same message doesn’t even start with all the usual info. There are 2 other (live) VS on this VM so I know they are working OK (so not the webserver)

also checked under nginx configurations and the new domain is not listed anywhere - so puzzled as to where it is.

So tried a reboot and tried adding the domain as a top level VS - it worked :man_shrugging:

as that was not what was wanted - I deleted it

then attempted to re install as an alias (as before) and it failed again! this makes no sense to me.
I have searched through all the nginx.conf files and cannot find the ghost reference grep -rnw '/etc/nginx/' -e 'domain.org' = nothing
so where is it?
also waited for a grep -rnw '/etc/' -e 'domain.org' = nothing :exploding_head:

This looks like an easy manual addition. Have you tried that? It looks like it all gets added to the same line in nginx. Might deliniate whether this is a Virtualmin or Nginx issue.

"So for example if you have this Apache config:

ServerName acme.com
ServerAlias www.acme.com
ServerAlias acmeinc.com www.acmeinc.com

Then for Nginx use:

server_name acme.com www.acme.com acmeinc.com www.acmeinc.com

This is a simple example for full details see this page in the Nginx documentation:

ServerAlias On Nginx Reliable Penguin - Blog "

I couldn’t reproduce it—maybe the alias you tried to add matched the hostname?

No the host name is usa2.xyz.tld and declared as usual (as expected) on the dashboard. the domain in question is domain.org and is being added to a top-level domain domain.cloud where there is already a alias domain.app. I cannot think of anywhere the host name is stored under ‘/etc/’ or elsewhere.

@ID10T
both the domain.app and domain.cloud and their www, and mail. equivalents are listed under the correct nginx conf. It is exactly where I would expect the domain.org to go.

domain.app is working - and showing domain.cloud as one would expect.

I don’t know if it can help but you said:

just tried again as a “top level” this time and that has also failed

And then

So tried a reboot and tried adding the domain as a top level VS - it worked

If it wasn’t working for Top level before the reboot but was working after it. Well; it means something changed in the configuration since the previous reboot. Which might be you who tested something (I don’t know it’s a suggestion)

So all alone it means there is a problems with the settings. If there was no problems, the reboot itself wouldn’t change anything. Maybe it might put you on the right direction. (Sorry if it doesn’t :grin: I’m not on Nginx, so can’t help more)

OK following a lot of rather wasted time chasing the :ghost: in the system I did what I should have done at the beginning reload from a backup!

then the addition of the new domain alias worked as expected :face_with_spiral_eyes:
grep on nginx now shows the domain exactly where I expected it to be also under etc/webmin/miniserve and etc/webmin/virtual-server
(I am sort of content to suspect a package update during the reboot)

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.