【发布时间】:2015-01-01 08:18:47
【问题描述】:
我一直在使用 Phalcon 在本地开发环境(Vagrant + Virtualbox)中开展一个项目。它真的很好用,我的开发时间真的减少了。
现在我想在 Plesk 11.5 nginx 环境中上线这个项目,我遇到了在 Plesk for Phalcon 中配置 Nginx 的问题。我对 Nginx 也很陌生。
我有以下 Nginx 配置:
server {
listen 80;
server_name localhost.dev;
index index.php index.html index.htm;
set $root_path '/var/www/httpdocs';
root $root_path;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
我删除了“server {}”,因为这些在 Plesk nginx 配置中是不允许的。但是,它只是行不通。应用程序的主页完美显示,因此 Phalcon 运行良好,但路由不起作用:/search 仅给出 404,它在我的本地环境中使用此配置工作。
我应该在 Plesk 中进行哪些更改才能完成这项工作?
提前感谢您的宝贵时间!
【问题讨论】:
标签: php nginx plesk phalcon phalcon-routing