如何解决尝试编辑草稿页时,SilverStripe 4 / NGINX重定向到404
我得到了一个NGNIX服务器,该服务器以前仅安装了Ubuntu 18.04和NGNIX,并用于呈现静态html站点。
我已经安装了PHP,MySqli ect并配置了网站可用文件来启动并运行网站。将数据库从开发站点导入到实时站点后,除一个错误外,该站点运行正常,完全正常。
如果在“拆分模式”或“预览模式”下单击草稿页,则会重定向到管理员中的“找不到页面”。如果我切换到“编辑模式”,则一切正常。 发布草稿页后,就可以在“拆分模式”或“预览模式”下查看它了。
我想知道它是否与我的NGNIX配置有关。我使用以下链接配置了网站可用/默认文件: https://www.nginx.com/resources/wiki/start/topics/recipes/silverstripe/#recipe
这是我的ngnix网站可用的配置文件
server {
include mime.types;
default_type application/octet-stream;
#listen 80 default_server;
#listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
ssl_certificate /etc/ssl/certs/certificate.pem;
ssl_certificate_key /etc/ssl/private/key.key;
root ****************
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name ****************;
location / {
# First attempt to serve request as file,then
# as directory,then fall back to displaying a 404.
try_files $uri /index.php?query_string;
}
error_page 404 /assets/error-404.html;
error_page 500 /assets/error-500.html;
# see caveats
error_page 502 /assets/error-500.html;
error_page 503 /assets/error-500.html;
location ^~ /assets/ {
sendfile on;
try_files $uri =404;
}
location /index.php {
fastcgi_buffer_size 32k;
fastcgi_busy_buffers_size 64k;
fastcgi_buffers 4 32k;
fastcgi_keep_conn on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files,if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
当我导航到/install.php时,没有警告或错误。
关于什么可能导致这种情况的任何线索?让我知道是否需要更多信息。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。