【发布时间】:2018-07-19 18:32:47
【问题描述】:
我正在尝试设置 nginx 以开始使用 phalcon,这是配置:
server {
listen 80;
server_name localhost.dev;
set $root_path '/usr/share/nginx/html/phalcon/public';
root $root_path;
index index.php index.html index.htm;
charset utf-8;
rewrite_log on;
location / {
try_files $uri $uri/ /index.php?_url=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path/public;
}
location ~ /\.ht {
deny all;
}
}
我尝试了所有可能的方法,但仍然无法正常工作。 有什么线索吗?
【问题讨论】:
-
在阅读了这里的文档后:php-phalcon-docs.readthedocs.io/en/latest/reference/nginx.html,调整了一些值,瞧,它现在可以工作了!
-
如果答案中还没有解决方案,请不要犹豫并发布。这将使所有人受益。