NGINX服务器上的Kirby CMS



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

首页写得不错,但其他页面我都是404分。

Kirby安装到目录深层(网站.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文件已经复制到您的服务器上。

相关内容

  • 没有找到相关文章

最新更新