Submitted by jasongayson on Thu, 02/07/2013 - 20:50
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.)
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Thu, 02/07/2013 - 23:24 Comment #1
Are you sure it is creating a whole new
server
block? An alias in Nginx is supposed to be added by Virtualmin as a newserver_name
entry in the target domain's block.Submitted by jasongayson on Thu, 02/07/2013 - 23:58 Comment #2
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.