【发布时间】:2017-11-29 15:17:16
【问题描述】:
我遇到了一个非常随机的问题。每当我通过 http 协议访问我的网站时,都会下载 wp-blog-header.php 文件,或者我只是从 cloudflare(我正在使用)收到 502 错误。该文件内容如下:
<?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('./wp-blog-header.php');
当我通过 https 协议访问该站点时,我没有遇到此问题。
我的 wp-config.php 文件中有以下内容
define('WP_HOME','https://somersetbaby.com');
define('WP_SITEURL','https://somersetbaby.com');
以下是我的站点的 nginx 配置文件:
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
ssl_certificate /not/here/somersetbaby.pem;
ssl_certificate_key /not/here/somersetbaby.key;
server_name somersetbaby.com www.somersetbaby.com;
access_log /var/log/nginx/somersetbaby.com.access.log rt_cache;
error_log /var/log/nginx/somersetbaby.com.error.log;
root /var/www/somersetbaby.com/htdocs;
index index.php index.html index.htm;
include common/wpfc-php7.conf;
include common/wpcommon-php7.conf;
include common/locations-php7.conf;
include /var/www/somersetbaby.com/conf/nginx/*.conf;
我也有一个默认文件,但如果我删除它,我会收到 521 错误,并且网站将无休止地重新加载,如果我包含它,我无法让网站强制使用 SSL。
任何帮助将不胜感激。
谢谢
【问题讨论】: