【发布时间】:2018-01-20 13:57:46
【问题描述】:
我刚刚在运行 NGINX 的新服务器上安装了一个 Ghost 博客。 Ghost config.json 文件指向正确的目录 /blog 并且当我访问它时博客加载正常。
不起作用的是,当我从 URL 中删除 /blog 时,我会进入 404 页面。我检查了启用站点的文件,如下所示:
server {
listen 80;
listen [::]:80;
server_name *********;
root /var/www/ghost/system/nginx-root;
location ^~ /blog {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://*********:2368;
proxy_redirect off;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
但我不完全确定需要更改哪些内容才能避免出现 404 错误。我有一个示例 .php 文件,应该加载但没有。
我一直使用 Digital Ocean One-Click Ghost 应用程序,但这次我想使用 Ghost CLI。我有一种感觉,我错过了一些东西。
【问题讨论】:
-
在
/var/www/ghost/system/nginx-root上创建index.php -
试过了,但它现在给了我一个 403 Forbidden 错误。
-
没关系 - 我错过了关于 PHP 文件的部分......