2013-07-08 2 views
4

Я пытаюсь настроить NGINx-сервер для работы с Phalcon PHP Framework. До сих пор я искал помощи в Интернете, но я не мог найти что-нибудь ...Как настроить Phalcon в файле конфигурации Nginx

Мой файл конф является:

server { 
#listen 80; ## listen for ipv4; this line is default and implied 
#listen [::]:80 default ipv6only=on; ## listen for ipv6 

root /usr/share/nginx/www; 
index index.php index.html index.htm; 

# Make site accessible from http://localhost/ 
server_name localhost; 

location/{ 
    # First attempt to serve request as file, then 
    # as directory, then fall back to index.html 
    try_files $uri $uri/ /index.html; 
    # Uncomment to enable naxsi on this location 
    # include /etc/nginx/naxsi.rules 
} 

location /doc/ { 
    alias /usr/share/doc/; 
    autoindex on; 
    allow 127.0.0.1; 
    deny all; 
} 

Что следует добавить к нему для того, чтобы сделать Phalcon работу? Спасибо.

ответ

0

я столкнулся с той же проблемой, и, наконец, получил эту работу здесь мой конфигурационный файл, используя Windows 7 и PHP 5.3 в режиме Fast CGI.

server { 
      listen  80; 
      server_name localhost; 
      set   $root_path 'C:/devtools/phalcon/test/public'; 
      root  $root_path; 
      index index.php index.html index.htm; 
     try_files $uri $uri/ @rewrite; 
     location @rewrite { 
          rewrite ^/(.*)$ /index.php?_url=/$1; 
          } 

     location ~ \.php { 
     try_files $uri =404; 

     fastcgi_index /index.php; 
     fastcgi_pass 127.0.0.1:9123; #default is 9000, i am using 9123 
     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; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
}