Nginx logrotate후에 로깅이 안되는 문제 (Nginx not logging after logrotate)
2022. 4. 27. 15:30ㆍ개발 이야기
문제
Nginx logrotate 수행 이후 더 이상 로깅이 안되는 문제가 발생했다.
/var/log/nginx/*.log {
daily
dateext
dateyesterday
missingok
ifempty
rotate 90
compress
create 640 nginx root
sharedscripts
olddir /var/log/nginx/backup
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
설정 파일 내용은 위와 같다.
해결
권한을 잘 관리하겠다고 chmod
를 빡빡하게 700
으로 줬던 게 문제였다.
내부적으로 file reopen이 안되는것 같다.
nginx 로그 폴더 권한을 755 정도로 변경하자
Change your nginx's log directroy permission to 755 or 750
$ chmod 755 /var/log/nginx
'개발 이야기' 카테고리의 다른 글
Spring Boot 2.x에서 3.x로 업데이트 (0) | 2023.04.04 |
---|---|
(React) proxy기반의 반응형데이터 관리 (0) | 2022.07.08 |
typescript, babel, jest 모듈 환경 구성 (0) | 2022.04.23 |
Spring boot 2.4.5 @AuthenticationPrincipal occurs null (1) | 2021.04.30 |
Vue.js 간단한 플러그인 만들기 (0) | 2020.11.20 |