2014-09-06 4 views
0

나는 nginx로 내 mangeto 웹 사이트를 설정하려고하지만 성공하지 못합니다. 여기 내 구성 http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magentoNGINX- PHP는 대신 index.php를 다운로드합니다.

: :이 튜토리얼을 따라

server { 
listen 80; 
server_name www.mydomainname.com *.mydomainname.com; 
root /var/www/mydomainname/web; 
index index.html index.htm index.php index.cgi index.pl index.xhtml; 
default_type application/octet-stream; 

location/{ 
    try_files $uri $uri/ /app.php?$query_string /index.php?$query_string; 
} 

location /dev { 
    auth_basic   "Restricted Area"; 
    auth_basic_user_file conf/htpasswd; 
    try_files $uri $uri/ /dev/index.php; 
} 

location ^~ /app/    { deny all; } 
location ^~ /includes/   { deny all; } 
location ^~ /lib/    { deny all; } 
location ^~ /media/downloadable/ { deny all; } 
location ^~ /pkginfo/   { deny all; } 
location ^~ /report/config.xml { deny all; } 
location ^~ /var/    { deny all; } 

location /var/export/ { ## Allow admins only to view export folder 
    auth_basic   "Restricted"; ## Message shown in login window 
    auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword 
    autoindex   on; 
} 

location /. { ## Disable .htaccess and other hidden files 
    return 404; 
} 

location @handler { ## Magento uses a common front handler 
    rewrite//index.php; 
} 

location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler 
    rewrite ^(.*.php)/ $1 last; 
} 

location ~ \.php$ { 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_index index.php; 
    include fastcgi_params; 
} 
} 

내가 mydomainname.com에 액세스 할 수 있습니다하지만 난 시작하려고 할 때 그것이 작동하지 않습니다 mydomainname.com/dev/ 하위 폴더에 젠토의 설치합니다. 내 웹 브라우저가 그것을 실행하는 대신 php 파일을 다운로드합니다. 그리고/var/www/mydomainname/web/dev /와 루트를 바꿨을 때 작동합니다. 이유를 알고 있습니까?

답변

0

그 이유는 PHP가 PHP-FPM에 전혀 전달되지 않기 때문입니다. NGINX는 PHP 자체를 말하지 않으며 PHP 요청을 처리하기 위해 일부 백엔드 서버가 필요합니다.

나는 그것이 위치에 들어오지 않는다고 생각합니다. ~ .php $ ...

관련 문제