Proxy WordPress from a Hypernode to a cluster domain

in Usage

It’s very easy to host your WordPress site on our cluster platform while proxying all traffic from the Hypernode to the cluster platform.

This way it is possible to serve your WordPress site as a subdirectory of your webshop while still physical separating the two hosting environments.

All traffic to your blog is passing through your Hypernode, so mind yourself you need enough resources to use this construction.

Configuration and installation on our cluster hosting platform

First order a cluster hosting package for domain.com if not done so already. Then install WordPress and make sure your WordPress installation is moved to a subdirectory. If your WordPress installation is served from http://www.domain.com/blog, register your domain.com as a cluster domain (in other words: order a cluster hosting plan for domain.com) and install your WordPress in domain.com/blog/

Make sure u change your hostfile when installing WordPress, to make sure the DNS points to the cluster IP address instead of the IP address of your Hypernode.

Service Panel actions

After installing WordPress in a subdirectory on your cluster domain, make sure you enable “Servicealias Catchall” in the Service Panel section “Subdomeinen”.

Configuration on the Hypernode

We use a HTTPS enabled site in this example. Change https to http if your WordPress blog is not using HTTPS.

Configure Nginx

When your WordPress is fully installed, create the following config as server.blog in /data/web/nginx.

location ^~ /blog {
    expires off;
    proxy_redirect off;

    proxy_pass https://<YOUR CLUSTER IP>;
    proxy_set_header Host www.domain.com;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X_FORWARDED_PROTO "https";
    proxy_set_header HTTP_X_FORWARDED_PROTO "https";
    proxy_set_header X-Real-IP \$remote_addr;
}

This will proxy all requests for /blog/ to our cluster servers.

Verify if your proxy is working

After configuration, remove the hostfile entries you created earlier and visit the WordPress backend to verify whether you are able to login.

Voila! That’s all.

0