[NGINX] Alias Domains in same config

When adding "alias" domains in Virtualmin, it creates a completely new NGINX alternative-hostname file with a full-blown PHP-CGI daemon and everything.

It makes more sense to create a tiny server-block with a redirect INSIDE the existing parent domain's config. Something like:

server { server_name myalias.domain.com send "302 moved" redirect to parent domain }

(It needs a bit more than that to work, but that's the basic idea; anytime someone hits the alias domain, they are thrown to the proper domain.)

Closed (fixed)


Are you sure it is creating a whole new server block? An alias in Nginx is supposed to be added by Virtualmin as a new server_name entry in the target domain's block.

You're right, I confused the issue when I was reading through my bug list (its entries contain very few words since I relied on memory instead). I can't remember what the original bug was about but it wasn't this after all. Closing the ticket.