gpt4 book ai didi

php - NGINX 服务器上的 Kirby CMS

转载 作者:搜寻专家 更新时间:2023-10-31 21:27:51 24 4
gpt4 key购买 nike

我在 DigitalOcean 上有一台 Ubuntu 14.04 服务器,配置了 NGINX 虚拟主机,我试图在其中托管 Kirby CMS 站点。

首页工作正常,但我在任何其他页面上都收到 404。

Kirby 安装到目录深处 (website.com/sub/dir/)

不确定是否最好为 Apache 使用反向代理,或者修复 Kirby 以便它与 NGINX 一起工作,或者做这两者的最佳方法是什么......

有没有人能回答这个问题?我会提供您需要的任何信息,让您更轻松地完成这项工作。


这里有一些(希望)有用的文件:

etc/nginx/sites-enabled/website.com

server {
listen 80 default_server;

root /var/www/website.com/public_html;
index index.php index.html index.htm;

server_name website.com www.website.com;
location / {
try_files $uri $uri/ /index.php;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

/etc/nginx/nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

server {
client_max_body_size 100M;
}

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##

#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;


proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;


##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

最佳答案

确保支持并启用 MOD_REWRITE。如果这不能解决问题,请尝试使用其他 Web 服务器,例如 Apache 和 LiteSpeed。我只尝试过这两个,所以我不能过多谈论 NGINX。我假设 .htaccess 文件已复制到您的服务器。

关于php - NGINX 服务器上的 Kirby CMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33634285/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com