CMS솔루션마켓, 이온디 - 워드프레스, 라이믹스, 카페24, 그누보드, 엑셀

웹기술을 같이 공유합니다

Home WEB 웹팁
Nginx 서버에서 서브디렉토리(subdirectory)에서 index 파일을 못 가져오는 경우

[1] project.eond.com/
[2] project.eond.com/shu
[3] project.eond.com/shu/index.html

실제 index.html 파일이 있는데도, [2]로 접속했을 때 404 오류를 뿜더군요.
nginx 설정파일을 몇십번이나 수정하고 재시작해도 안되길래,
마지막 xe 설정 파일 부분을 빼니 잘 되네요 ㅠㅠ

 
location / {
   root   /home/project/www;
   index index.php index.html;
}
location /shu {
   alias /home/project/www/shu;
   index index.html;
}
xe_config 파일에 보면 mid link 라는 부분에 이렇게 수정했습니다.
# mid link
rewrite ^/shu/ /shu/index.html last;
rewrite ^/xe/?$ /xe/index.php?mid=$1 last;
rewrite ^/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;
#rewrite ^/xe/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;


추천한 사람

 
댓글은 로그인 사용자만 작성 가능합니다. 로그인하기