2016-06-09 2 views

답변

0

등가 재 작성은 다음과 같습니다

if (!-e $request_filename){ 
    rewrite ^/?(.*)$ /index.php?url=$1 last; 
} 

nginx로 URI는 스크립트가 아마 원하지 않는 최고의 /을 포함한다. 또한 .php 파일은 다른 위치 블록에서 처리 될 가능성이 있으므로 last을 사용해야합니다. use of an if block없이이 글을 쓰는의

대체 방법 :

첫째, 주요 /과 :

location/{ 
    try_files $uri $uri/ /index.php?url=$uri; 
} 

둘째, 주요 /없이 :

location/{ 
    try_files $uri $uri/ @rewrite; 
} 
location @rewrite { 
    rewrite ^/?(.*)$ /index.php?url=$1 last; 
} 

모든 nginx 지침은 documented here .

+0

감사합니다. –

관련 문제