2014-04-07 1 views
0

이 mod_rewrite를 나의 오래된 아파치 설정 (htaccess)에 넣고 nginx 설정을하려고하는데 실제로 어떻게 nginx에서 실제로 작동하는지 이해할 수 없다. , 나는이 모든 nginx 물건에 초보자, 누구든지이 번역을 도울 수 ... 정말 미리 감사드립니다.나는 내 htaccess를 번역 할 필요가있다.

현재 htacces 파일 :

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_URI} !^(/static/) 

    RewriteRule . /app.php [L] 
</IfModule> 

가상 설정 파일 test.url :

server { 
    server_name test.url; 
    access_log /var/www/test.url/logs/access.log; 
    error_log /var/www/test.url/logs/error.log; 
    root /var/www/test.url/public_html/blank; 

    location/{ 
     app.php; 
    } 

    location ~ \.php$ { 
     include /etc/nginx/fastcgi_params; 
     fastcgi_pass 127.0.0.1:9000; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME /var/www/test.url/public_html/$ 
    } 
} 

답변

1

대신 :

location/{ 
    app.php; 
} 

시도 :

location /static/ { 
    # do nothing, we don't want to rewrite /static/ 
} 

location/{ 
    try_files $uri $uri/ /app.php 
} 
+0

감사합니다. 당신은 내 하루를 보냈습니다;) 나는 이것을 이해하기 시작했습니다. 한 가지만 잊어 버렸습니다. ";" "try_files ... 끝에 – Dazag

관련 문제