The Hypernode Managed Vhosts (HMV) system is an easy to use, yet powerful, system of configuring NginX on Hypernode. A vhost is a configuration that allows you to setup multiple domainnames, each with it’s own, independent, configuration. With it, you can easily host a WordPress blog on a subdomain, and a Magento on your main domain, set up https for both automatically, and efficiently redirect visitors to your www-domain.

The main advantage of HMV is that it separates your NginX config into a global folder, containing configuration for all server blocks, and domain specific configs, giving you more control and reducing unexpected side-effects of domain specific configurations.

Enabling Managed Vhosts

The Hypernode Managed Vhosts (HMV) system is currently still disabled by default on all Hypernodes. This means that your Hypernode is still running in ‘legacy’ mode. To enable the HMV you can run the command hypernode-systemctl settings managed_vhosts_enabled --value True. This will convert your current legacy config into the HMV config. It will also convert all currently active vhosts into managed vhosts.

Managing Vhosts

Once the Hypernode Managed Vhosts (HMV) system is enabled, you can start defining and configuring your vhosts.

Adding Vhosts

To add a new vhost, for example the domainname, to your configuration, you can simply run the command hypernode-manage-vhosts This will create a new vhost configuration in /data/web/nginx/, using the Magento 2 template. You can define the configuration template to use, by using the --type argument. For example, you can use the Magento 1 config by using the command hypernode-manage-vhosts --type magento1 You can choose from ‘magento1’, ‘magento2’, ‘akeneo’, ‘vuestorefront’, and more. For a complete list of available templates you can run the command hypernode-manage-vhosts --help.

Important: Simply creating the folder does NOT create a vhost. You will need to use the hypernode-manage-vhosts command

Please note that defining the vhosts ‘’, does not automatically add ‘’ as a vhost. You will have to manually define a vhost for this. Since most people simply want their ‘’ to redirect to ‘’, you can simply use the –type wwwizer argument to set this up. This will configure the vhost to redirect all traffic to the www-version of the domain.

Removing Vhosts

To remove an existing vhost, for example the domainname, from your configuration, you can simply run the command hypernode-manage-vhosts --delete This will remove the vhost configuration, and remove /data/web/nginx/

Please note that simply deleting the /data/web/nginx/ folder will NOT remove the vhost, but merely leave it in an unconfigured state.

Changing Vhosts

Once a vhost is configured, you cannot change the template used to create it. This is because the files from the templates are placed as a user-editable files, and changes may have been made to these. It is, however, possible to manually change the configuration. Alternatively, you can remove and recreate the vhost with the correct type. Please do note that this will remove all the existing configuration made for this specific domain name.

Listing Vhosts

To list all configured vhosts you can run the command hypernode-manage-vhosts --list. You can also use the --format argument to get the output in a variety of machine readable formats, to meet your own automation needs.

Managing Configuration files

Vhost-specific configuration

Once you have setup a vhost, say, you can place your domain specific configuration in its configuration folder, /data/web/nginx/ You can do this the same way you configured your legacy, or global configuration. Simply place a file with a server. prefix, and it will be included in the vhost’s server {} configuration block. You can also still use the public. and staging. prefixes, if you wish to have public, or staging, specific configuration.
Please note that any files with the ‘http.’ prefix will also be loaded in the http context. NginX, however, only has a single http context. As such, any http configuration placed in a vhost, will also be loaded for all other vhosts.

Global configuration

Even when using the Hypernode Managed Vhosts (HMV) system, it’s still possible to setup configuration on the ‘global’ level by placing a file in /data/web/nginx.

Multi-domain configuration

If you have multiple vhosts, and want to share configuration between them, without placing this in the global context, you can do so using symlinks. Simply remove a domain specific folder and replace it with a symlink to another domain’s folder.