Nginx open() "/etc/nginx/nginx.conf" 실패 [닫기]

Nginx open() "/etc/nginx/nginx.conf" 실패 [닫기]

매우 간단한 Linux에서 nginx를 실행하려고 하는데 실행하려고 하면 다음과 같은 메시지가 나타납니다.

[emerg] 4905#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)

그리고

[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

이제 내 문제는 /etc읽기 전용 파일 시스템에 있으므로 디렉터리를 만들 수도 없고 해당 디렉터리에 심볼릭 링크를 걸 수도 없습니다. 모든 것이 설치되었지만 작동하지 않습니다 /opt/etc/....nginx -c /opt/mnt/nginx/nginx.conf

nginx를 실행하는 방법은 무엇입니까?

답변1

/etc읽기 전용 이므로 비슷한 방법을 사용 aufs하여 그 위에 다른 디렉터리를 덮어쓰고 변경하면 효과적으로 rw/etc를 제공할 수 있습니다. 예를 들어:

mkdir /myconfig /mnt/etc
mount -t aufs br=/myconfig:/etc /mnt/etc
mount -o bind /mnt/etc /etc

관련 정보