안녕하세요. 선배님들.
다음과 같은 개발 환경에서 CI4 설치 후 Welcome Page가 보이지 않아 질문드리려고 합니다.
(http://139.162.74.137/ci4-board)
>>> 개발환경
웹 루트는 /home/계정/www/ 를 사용하고 있으며, 서브 폴더로 learning-php, ci4-board 를 두고 있습니다.
/usr/share/nginx/html/ 폴더에 심볼릭 링크를 만들어 앞에 언급한 각각의 서브 폴더를 가리키도록 되어있습니다.
learning-php 폴더에는 프레임워크 없이 순수 php 파일 실습을 위한 폴더이며 안에 파일들은 잘 동작하고 있습니다.
(http://139.162.74.137/learning-php/01/phpinfo.php)
ci4-board 폴더는 상위 폴더에서 composer create-project codeigniter4/appstarter ci4-board 명령을 실행하여 생성하였습니다.
ci4-board 하위 폴더 포함 권한은 775로 주었습니다..
/etc/nginx/conf.d/default.conf 파일의 내용을 다음 두 개의 사이트를 참고하여 수정했는데 403 또는 File not foud. 표시됩니다.
참고하실 수 있도록 /etc/nginx/conf.d/default.conf, /var/log/nginx/error.log 파일 내용을 첨부 드립니다.
긴 글 읽어주셔서 감사합니다.
답변 감사드립니다.
링크 달아주신 영상을 보고 변경했는데
동일한 문제가 발생합니다. 계속 시도해보겠습니다. ^^
혹시 퍼미션 수정 이후 에러로그가 바뀌지 않으셨을까요?
답변이 늦어 죄송합니다.
에러 메시지가 변경되어 틈틈히(?) 알아보고 있습니다.
아래 default.conf 파일에 try_files 부분을 아래 케이스에서 변경시켜 보고 있습니다.
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location /ci4-board {
root /usr/share/nginx/html/ci4-board/public;
try_files $uri $uri/ /index.php/$args;
# try_files $uri $uri/ /index.php$is_args$args;
# try_files $uri $uri/ /index.php;
# try_files $uri $uri/ /index.php?;
}
try_files $uri $uri/ /index.php/$args; 경우에는 Nginx 의 404 페이지가 표시되고,
error.log 는 다음과 같습니다. 맵핑이 잘못된 듯 합니다.
2021/01/21 18:00:13 [error] 3089170#3089170: *8 "/usr/share/nginx/html/index.php/index.php" is not found (2: No such file or directory), client: 59.15.174.222, server: localhost, request: "GET /ci4-board HTTP/1.1", host: "139.162.74.137"
그리고 나머지 경우에는 브라우저에서는 File not found. 문자열만 덩그러니 표시되고 error.log 는 아래과 같습니다.
2021/01/21 17:46:38 [error] 3088999#3088999: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 59.15.174.222, server: localhost, request: "GET /ci4-board HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "139.162.74.137
모든 경우 try_files 부분을 제대로 적지 않아 php 파일 맵핑이 안되고 있는 듯 한데, 차근차근 해보겠습니다.
감사합니다. ^^