【发布时间】:2021-09-29 16:33:00
【问题描述】:
我在我的服务器上使用 nginx 和 php-fpm7.2。当我尝试打开我的 WordPress 网站时,它不会加载,只是下载页面。我可以通过 url 访问除主页之外的所有其他页面。它发生在今天,我没有修改任何配置文件。 fastcgi 和同一台服务器上的其他站点正在运行。我尝试了任何我能找到的解决方案,但没有一个可以解决。 网站下载的文件如下
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
这是我网站的配置文件
server
{
listen 80;
#listen [::]:80;
server_name sur.net.cn ;
index index.php ;
root /home/wwwroot/sur.net.cn;
include rewrite/none.conf;
#error_page 404 /404.html;
include enable-php.conf;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name sur.net.cn ;
index index.php ;
root /home/wwwroot/sur.net.cn;
ssl_certificate /home/wwwroot/ssl/5176542_sur.net.cn.pem;
ssl_certificate_key /home/wwwroot/ssl/5176542_sur.net.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
ssl_session_cache builtin:1000 shared:SSL:10m;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
include rewrite/none.conf;
#error_page 404 /404.html;
include enable-php.conf;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
【问题讨论】: