This release allows you to enable support for the new hypernode-manage-vhosts
command on your Hypernode. This commands allows for easy management of your Nginx server blocks, or commonly referred to as VHosts, on your Hypernode.
Managing your VHosts in an easy manner becomes increasingly important if you want to set up multiple VHosts on your Hypernode. This becomes relevant if you want to make use of useful services such as Progressive Web Apps or host a Product Information Management (like Akeneo) service next to your CMS.
Enabling this can be done via the command line.
What does hypernode-manage-vhosts
do?
The hypernode-manage-vhosts
allows you to easily set up and manage one or more VHosts on your Hypernode. This command will manage the Nginx configurations on your Hypernode based on the input that you give to the hypernode-manage-vhosts
command, while still giving you the freedom to adjust your Nginx configurations to your own needs.
If you want to specify option for multiple VHosts you can simply run hypernode-manage-vhosts a.example.com b.example.com <other-arguments>
(or hypernode-manage-vhosts {a,b}.example.com <other-arguments>
if you’re a command line wizard) or hypernode-manage-vhosts --all <other-arguments>
if you want to manage multiple VHosts in one go.
SSL management
When creating or updating a VHost with hypernode-manage-vhosts
, you can specify whether or not the VHost should serve content over HTTPS. Using the --https
flag, you can choose to use an SSL certificate placed on the Hypernode via the Service Panel. If there is no SSL certificate present on the Hypernode for the given VHost, hypernode-manage-vhosts
will automatically request a new Let’s Encrypt certificate and place a renewal job in your crontab.
If you want to automatically redirect all traffic from HTTP to HTTPS, you can use the --force-https
option to place the correct Nginx configurations to redirect all traffic with a 301 HTTP response status code.
Varnish
Automatic Nginx configurations for Varnish come out of the box with this command, allowing you to be flexible in which VHosts should have caching by Varnish in front of your webshop. This does not manage your VCL configuration files for you, but it does place any necessary Nginx configurations to get you going.
VHost types
At this moment in time we support several default Vhost types which will place a set of Nginx configuration files in your Nginx configuration directory /data/web/nginx
. For now we added the following types:
- Magento 1
- Magento 2
- Vue Storefront
- Akeneo
- AB testing
These types will only place default config files and will not alter the behaviour of the root Nginx configuration. Later on we will be adding more of these VHost types so that you can get started on managing other types of VHosts in an easier manner.
What changes if I start using hypernode-manage-vhosts
?
If you want to change your Nginx configuration with the current setup you place your Nginx configuration files under the /data/web/nginx
directory. When you start using hypernode-manage-vhosts
you can place Nginx configuration files for a specific VHost (like example.com
) under /data/web/nginx/example.com
and Nginx configuration files that should be applied on all your VHosts in /data/web/nginx
like you would do regularly.
With hypernode-manage-vhosts
you can now also specify where you want your webroot to be. Previously we required you to have your site’s source code in /data/web/public
, but you can now configure this yourself. We will still hold default locations for the webroot (like /data/web/public
for Magento installations), but this is now open to be changed.
How can I start using it?
You can enable this feature on your Hypernode by running the following command: hypernode-systemctl settings managed_vhosts_enabled --value True
. This will start a transition_to_managed_vhosts
job (which you can track with the livelog
command) that will transition your Nginx configuration files over to this new managed VHosts feature. Note that this transition period will start moving around Nginx configuration files, causing your site to go down for a brief moment.
Once this transition job is done, you can start managing your Nginx VHosts using the hypernode-manage-vhosts
command. Run hypernode-manage-vhosts --help
to get an overview of all the possible settings you can tweak for all your VHosts.