I developed some wordpress site on windows and there it worked fine without any problems. Now I need to migrate to Ubuntu 18.04 Server with Nginx and PHP 7.2 at board.
I do all by manuals, but any wordpress page are opens as blank white page :( I tested it by adding to main folder phpinfo.php with phpinfo(); code and it opens without problems as domain/phpinfo.php, images and html files are also opens without problems as domain/image.png or domain/file.html.
The most awful thing is that I didn't get any errors :(
Here are my domain config:
map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ; }
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; }
server {
server_name domain;
root /srv/domain;
index index.php;
access_log /var/log/nginx/domain.access.log;
error_log /var/log/nginx/domain.error.log;
location ~ ^(/[^/]+/)?files/(.+) {
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ;
access_log off; log_not_found off; expires max;
}
#avoid php readfile()
location ^~ /blogs.dir {
internal;
alias /srv/domain/htdocs/wp-content/blogs.dir ;
access_log off; log_not_found off; expires max;
}
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
location / {
try_files $uri $uri/ /index.php?$args ;
}
location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
try_files $uri =404; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
#add some rules for static content expiry-headers here }
Here are my nginx.conf file:
user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf;
events { worker_connections 768; }
http {
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
Thanks in advance