2014-11-05 3 views
1

로컬 개발 환경 (Vagrant + Virtualbox)에서 Phalcon 프로젝트를 진행하고 있습니다. 그것은 훌륭하게 작동하고 개발 시간은 실제로 줄어 들었습니다.Plesk 11.5 서버에서 Phalcon 용 Nginx 구성

이제이 프로젝트를 Plesk 11.5 nginx 환경에 온라인으로 넣고 Pulsk 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; 
    } 
} 

내가 제거 "서버를 {}"사람들은 Plesk를 nginx를 구성에서 사용할 수 없습니다 때문입니다. 그러나, 그것은 단지 작동하지 않습니다. 응용 프로그램의 홈페이지가 완벽하게 표시되므로 Phalcon은 정상적으로 실행되지만 라우팅은 작동하지 않습니다./search는이 구성으로 내 환경에서 작동하는 404를 제공합니다.

이 작업을하려면 Plesk에서 무엇을 변경해야합니까?

미리 감사드립니다.

답변

0

먼저 PHP-FPM 또는 Apache가 도메인 처리중인 PHP를 확인하십시오.

아파치와 PHP가 처리하는 역방향 프록시처럼 nginx를 사용하는 경우에는 Phalcon 부트 스트랩 index.php와 .htaccess를 /var/www/vhosts/domain.tld/httpdocs에 배치하고 다른 모든 응용 프로그램 파일은 가장 쉬운 방법은 정의하는 것입니다 PHP-FPM의 경우 (I 성공적으로 이러한 구성에 Phalcon 자습서를 실행했습니다)

을 /var/www/vhosts/domain.tld하는 custom virtual host template

mkdir -p /usr/local/psa/admin/conf/templates/custom/domain 
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/ 

그리고 /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php에서 y에 대한 조건을 만듭니다. 우리의 도메인 이름은 다음과 같이 전체 설정을 표시합니다.

<?php if $VAR->domain->asciiName == 'your-domain.tld' ?> 

    plain text of your full nginx config here 

<?php else: ?> 

    plesk default instruction for all other domains 

<?php endif ?>