lithium을 nginx 서버에 배포하고 싶지만 Apache 및 IIS에만 제공되는 구성이 있습니다. 나는 과거에 여러 응용 프로그램에 대해 여러 nginx 서버 구성을 성공적으로 작성했지만이 문제로 인해 어려움을 겪고 있습니다.nginx에서 리튬 구성
이미 nginx 및 리튬 포럼에서이 질문을 물었습니다.
이것은 내가 지금까지 작성한 것 중 가장 좋습니다.
root /var/servers/my_app/app/webroot;
location/{
index index.php;
try_files $uri $uri/ index.php;
}
location ~ \.php {
fastcgi_pass unix:/tmp/php.socket;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/servers/my_app/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
문제는/(루트 페이지)에 있습니다. 모든 링크는 index.php를 앞에 붙입니다. 대신
www.example.com/something
의 난이도의 nginx 관련 구성 또는 오히려 어떤 경우 아파치/IIS 환경을 감지 할 수없는 경우, 그 리튬가하는
www.example.com/index.php/something
확실하지 얻을. 어쨌든 나는 그것을 풀 수 없다.
직접 URL 입력을 통해 "www.example.com/test"에 액세스 할 때 페이지가 올바르게 렌더링되지만 www.example.com/test/ (후행 슬래시 포함) 및 " www.example.com/test/anything_here "가 깨졌습니다 - 모든 링크가 현재 URL에 추가됩니다.
www.example.com/test/
www.example.com/test/test
www.example.com/test/test/test
편집 : 업데이트 된 구성 (죄송 훨씬 지연 편집을 위해,하지만 난 여전히 붙어 최근이 문제를 해결 다시 시작)
root /var/server/my_app/app/webroot/;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
location ~ \.php {
fastcgi_pass unix:/tmp/php.socket;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/servers/my_app/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
location ~/\.ht {
deny all;
}
}
같은 링크를 누르면이 생성의견에서 언급했듯이 이제는 모든 링크가 index.php를 포함하게됩니다.
www.example.com/index.php/something
www.example.com/index.php/stylesheet.css
@even 나는 동일한 문제가있었습니다. 나는 Nginx에 대한 리튬 wiki에 대한 지침을 따라 갔지만 좋지는 않습니다. [여기] (http://serverfault.com/questions/389741/nginx-rewrite-rules-for-lithium-php-framework) 내 질문입니다 – lovesh