Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Aug 24, 2015 5:01 pm 
Offline

Joined: Mon Aug 24, 2015 4:19 pm
Posts: 1
I need help to setup a multi domain site on two VPS server with Linode. I will try to explain exactly what I want to achieve with setup.

When user visits site.com the html site well be displayed but if the user clicks on site.com/blog the user will see the Wordpress blog posts with in the specific language.

I want domain site.com to listen to both VPS servers depending on the request from the user. If the user clicks on about.html page the static site will be shown but if the user clicks on a blog post the user will see the post from the Wordpress site with the specific language.

**
Basically i want the main domain to always show static website but when a URL for the domain is site.com/blog-post-from-wordpress-on-server-b then it will show the Wordpress website.
**


The setup look like this.

VPS server A hosting 5 html static websites.
(Nginx server on Ubuntu 14.04 LTS x64)

site.com
site.se
site.dk
site.no
site.de

VPS server B hosting Wordpress Blog site.
(LEMP on Ubuntu 14.04 LTS x64)

site.com

Wordpress will be multilingual site pointing to domains with plugin WPML or Polylang

site.com/blog-post
site.se/blog-post-in-swedish
etc...

The both server are running Nginx with two different IP address

All domains are handle by cloudflare DNS

So far i have manage to show blog posts on url site.com/post-in-english/ but when i go to site.com the wordpress site is showing instead of the static html site and sometimes the static page depending on DNS relay for the IP addresses.

The DNS looks like this for site.com

@ A VPS server A IP pointing to var/www/site.com/html
@ A VPS server A IP pointing to /var/www/site.com/htdocs

Somehow it must go to configure this with NGINX server block file for each site.

Server Block for site.com on server A static html website

Code:
server {
      listen 80;
      listen [::]:80;

      server_name site.com www.site.com;

      if ($host = 'site.com' ) {
              rewrite  ^/(.*)$  http://www.site.com/$1  permanent;
      }

      root /var/www/site.com/html;
      index index.html index.htm;

      location / {
        try_files $uri $uri/ =404;
      }
}


Server Block for site.com on server B for Wordpress
Code:
server {


    server_name site.com   www.site.com;


    access_log /var/log/nginx/site.com.access.log rt_cache;
    error_log /var/log/nginx/site.com.error.log;


    root /var/www/site.com/htdocs;



    index index.php index.html index.htm;


    include common/wpfc.conf;

    include common/wpcommon.conf;
    include common/locations.conf;
    include /var/www/site.com/conf/nginx/*.conf;
}


Top
   
PostPosted: Wed Aug 26, 2015 11:29 am 
Offline
Linode Staff

Joined: Wed Jul 01, 2015 10:33 am
Posts: 59
This seems fairly complicated to set-up. Static pages take fairly little resources to serve, is there any reason why you can't do it on the same server? Perhaps set it up on the same server, then make it highly available across two Linodes and clone all the content?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group