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 subdir 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 cluster

First we need to install wordpress on our cluster domain. If you have done this already, make sure your wordpress is moved to a subdirectory.
If your wordpress install is served from http://www.domain.com/blog, register your domain.com as a cluster domain and install your wordpress in domain.com/blog/

Make sure u change your hostsfile when installing wordpress, to make sure the dns points to the cluster ip instead of the 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 the cluster servers.

Verify if your proxy is working

After configuration, change the

Voila! That’s all.

0