1
nginx 구성에 문제가 있습니다 (Apache에서 작동 함).nginx (Apache에서 작동)의 리디렉션 문제
location =/{
root /var/www/domain.tld/public_html;
index index.php;
}
location/{
root /var/www/domain.tld/public_html;
index index.php;
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php last;
break;
}
if (!-d $request_filename) {
rewrite ^(.*)$ /index.php last;
break;
}
}
# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|wmv)$ {
access_log off;
expires 30d;
}
문제는 내가 CSS/같은 DIRS에있는 정적 파일을했습니다 것입니다,/IMG, /의 JS 그러나 나는 또한 역할을하는 PHP는 컨트롤러가 : 나는 구성한 그래서 나는 재 작성을 수행했습니다 사용자가 파일을 업로드했으며 구조는 domain.tld/media/image/NAME/EXTENSION
입니다. 이것은 정적 파일을 얻으려고 시도하기 때문에 작동하지 않지만, domain.tld/media/image/NAME/EXTENSION/
(최종 파일은 /입니다)과 같이 작동하면 작동합니다.
어떻게 해결할 수 있습니까?
미리 감사드립니다.