Issue transferring WordPress website to another server

There is a problem with the site on WordPress after it was transferred to another server.

As a result, now I have 1 server with 2 domains and SSL’s attached:
1. WordPress, which was there initially. Works correctly;
2. WordPress, which moved from another server. Does not work;

Of course, the database was also migrated and the connection settings for it in wp-config.php were updated. And WordPress connects to the database, because if the connection parameters are changed, it shows a connection error to the database. If all the parameters are correct, then just a blank page is generated (absolutely empty).

Next I quote the contents of two files from sites-available (NGINX):
1. For the first domain, which initially worked on this server and continues to work adequately now:
server {
listen 80 default_server;
server_name firstdomen.ru www.firstdomen.ru;
return 301 https://firstdomen.ru$request_uri;
}

upstream memcached-servers {
server 127.0.0.1:11211;

}

server {
listen 443 ssl spdy;
server_name firstdomen.ru www.firstdomen.ru;
resolver 127.0.0.1;
root /var/www/firstdomen.ru/www;
index index.html index.htm index.nginx-debian.html index.php;

ssl_stapling on;
ssl on;
ssl_certificate "/etc/letsencrypt/live/firstdomen.ru/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/firstdomen.ru/privkey.pem";
ssl_trusted_certificate "/etc/letsencrypt/live/firstdomen.ru/chain.pem"; #Если используете OCSP
ssl_dhparam "/etc/letsencrypt/live/firstdomen.ru/dhparam.pem";
ssl_session_timeout 24h;
ssl_session_cache shared:SSL:2m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=31536000;";
add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report";

# Limit methods, allowed on server to GET, HEAD and POST
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}

location ~* \.(ico|gif|jpeg|jpg|png|eot|ttf|swf|woff)$ {
root /var/www/firstdomen.ru/www;
expires 30d;
access_log off;
}

location ~* \.(css|js)$ {
root /var/www/firstdomen.ru/www;
expires 7h;
access_log off;
}

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param HTTPS on;
}

location ~ /\.ht {
deny all;
}

location ~ ^/(wp-admin|wp-login\.php) {
allow 10.11.12.13;
deny all;
}

location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;

auth_basic "Enter Password";
auth_basic_user_file /home/firstdomen.ru/user/htpasswd;

location ~^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~*^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}

2. And this is the second domain that was transferred from another server:
server {
listen 80;
server_name www.seconddomen.ru seconddomen.ru;
return 301 https://seconddomen.ru$request_uri;
}

server {
listen 443 ssl spdy;
server_name seconddomen.ru www.seconddomen.ru;
resolver 127.0.0.1;
root /var/www/seconddomen.ru;
index index.html index.htm index.nginx-debian.html index.php;

ssl_stapling on;
ssl on;
ssl_certificate "/etc/letsencrypt/live/seconddomen.ru/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/seconddomen.ru/privkey.pem";
ssl_trusted_certificate "/etc/letsencrypt/live/seconddomen.ru/chain.pem"; #Если используете OCSP
ssl_dhparam "/etc/letsencrypt/live/seconddomen.ru/dhparam.pem";
ssl_session_timeout 24h;
ssl_session_cache shared:SSL:2m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers kEECDH+AES128:kEECDH:kEDH:-3DES:kRSA+AES128:kEDH+3DES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=31536000;";
add_header Content-Security-Policy-Report-Only "default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri /csp-report";

# Limit methods, allowed on server to GET, HEAD and POST
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}

location ~* \.(ico|gif|jpeg|jpg|png|eot|ttf|swf|woff)$ {
root /var/www/seconddomen.ru;
expires 30d;
access_log off;
}

location ~* \.(css|js)$ {
root /var/www/seconddomen.ru;
expires 7h;
access_log off;
}

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param HTTPS on;
}

location ~ /\.ht {
deny all;
}

location ~ ^/(wp-admin|wp-login\.php) {
allow 10.11.12.13;
deny all;
}

location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;

auth_basic "Enter Password";
auth_basic_user_file /home/firstdomen.ru/user/htpasswd;

location ~^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~*^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}

}

The auth_basic_user_file file for both domains is the same.
When trying to get into the admin of the second domain, for some reason, there is a redirection to the admin of the first domain.

I tried to add a couple more domains to the server without WordPress and SSL and it worked without complaints:
server {
listen 80;
server_name test.ru www.test.ru www.test.com;
return 301 http://test.com$request_uri;
}

server {
listen 80;
server_name test.com;
root /var/www/test.com;
index index.html index.htm index.nginx-debian.html index.php;
}

As far as I can tell, the error is in the NGINX configs, although I may be wrong.

What can help to fix this situation?

Advanced Web Care Professional Web Development

Server configurations should be exactly the same version. From ngnix to php, mysql and their extensions. The configuration should be the same, well, or as similar as possible. This is WordPress - you had to install MODX.

To work with different domains over SSL, Nginx must be with SNI support. Run nginx -V to get started and make sure the output has TLS SNI support is enabled.

It could also be a memcached issue. The Memcached Redux plugin used can work correctly if you add the WP_CACHE_KEY_SALT constant in wp-config.php of each site, for example:

define ('WP_CACHE_KEY_SALT', md5 (DB_NAME. $ table_prefix. __FILE__));

CONTACT US