Nginx로 React 프로젝트 배포하기(3) - (13: Permission denied) 오류

BM1201·2024년 6월 11일
0

Nginx

목록 보기
4/4
post-thumbnail

에러상황

ycits라는 사용자로 배포서버에 로그인을 한 후 아래의 소스처럼 nginx를 설정한 후 배포서버에 접속하였는데 에러가 발생하였고 에러로그를 확인해보니 (13: Permission denied) 에러가 발생하였습니다.

user : nginx
worker_processes auto;

events {
    worker_connections  1024;
}

http { 
    include       mime.types;
    server {
        listen       80;
        server_name  homepage;
        location / {
            root   /home/ycits/homepage/dist;
            index  index.html index.html;
        }
    }
}

에러해결 방법

  1. root경로가 제대로 설정되어 있는지 확인합니다.

  2. root경로로 접속하는 파일이 /etc/nginx/nginx.conf 설정에 있는 그룹으로 설정되어있는지 읽을수 있는 권한으로 잡혀있는지 확인합니다.

  3. /etc/nginx/nginx.conf의 user를 위에서 확인한 그룹의 유저로 변경합니다.

  4. 그래서 저의 경우에는 /etc/nginx/nginx.conf 파일의 user를 ycits로 변경하여 해결하였습니다.

Reference

profile
개발자의 기록하는 습관

0개의 댓글