보통 브라우저에 403 응답이 올 경우 발생 한다.


default logs 경로:  /var/log/nginx/error.log 중...


2013/04/26 15:13:28 [error] 3390#0: *12 open() "***************" failed (13: Permission denied), client: 10.0.2.2, server: ***************, request: "GET *************** HTTP/1.1", host: "***************", referrer: "***************"
2013/04/26 15:13:28 [error] 3390#0: *7 open() "***************" failed (13: Permission denied), client: 10.0.2.2, server: ***************, request: "GET *************** HTTP/1.1", host: "***************", referrer: "***************"


권한이 없다. 


해결 방법


1.  /etc/nginx/conf.d/xxxx.conf 확인


// ...

root /home/xxxxx/work/

// ...


2.  root 그룹 확인


drwxr-xr-x 14 xxxxx 

xxxxx 4096  x월 xx xx:xx xxxxx

drwxr-xr-x 11 xxxxx xxxxx 4096  x월 xx xx:xx xxxxx

[xxxxx@localhost work]$ 


3.  /etc/nginx/nginx.conf 수정

해당 그룹으로 user 수정


#user  nginx;

user  xxxxx;

worker_processes  1;


error_log  /var/log/nginx/error.log warn;

pid        /var/run/nginx.pid;



events {

    worker_connections  1024;

}



http {

    include       /etc/nginx/mime.types;

    default_type  application/octet-stream;


    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';


    access_log  /var/log/nginx/access.log  main;


    sendfile        on;

    #tcp_nopush     on;


    keepalive_timeout  65;


    #gzip  on;


    include /etc/nginx/conf.d/*.conf;

}


4.  서버 재 시작



[xxxxx@localhost work]$ sudo /etc/init.d/nginx restart




+ Recent posts