Question
WordPress/Nginx: some backend pages not showing until page refresh
I am just starting to setup my WP site and things are generally working fine but in the backend (WP-admin) I have this strange issue that some pages remain blank until I reload the page in the browser. In particular, this is the case when I go to Appearance -> Themes -> Customize. It produces an entirely blank page and when I refresh it, it shows what it’s supposed to show.
I believe the same issue occurs when I go to Plugins -> Add New and click on “More Details” of any of the displayed plugins. This will open up a screen overlay on which I see a rotating clock icon for half a second, then it disappears and the overlay stays blank. I can only assume that this is issue is the same because in this case I cannot refresh the blank page (as this will refresh the entire page, not just the overlay) but it seems plausible that the two are related. [Edit: just noticed that the turning clock also briefly shows in the first example]
I am not a developer so I can’t even tell what broader phenomenon this is a part of, except that these are php pages. So even if you don’t have the solution, if you could explain what I could search for, it would be much appreciated.
My hunch is that this issue might be due to some misconfiguration of Nginx so I paste my /etc/nginx/sites-available/default
below (the /etc/nginx/nginx.conf
is in its original state, not modified by me, so it should be fine.
upstream forum {
server 127.0.0.1:8080 fail_timeout=0;
}
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mydomain.net *.mydomain.net 46.101.***.***
return 301 https://$server_name$request_uri;
}
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-mydomain.net.conf;
include snippets/ssl-params.conf;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
include fastcgi.conf;
fastcgi_intercept_errors on;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×