현재 Rails 설정에서 NGINX를 사용하고 싶습니다. 구성 파일을 RAILS_ROOT/config/nginx
디렉토리에 저장했습니다. 여기에 내 config- 파일의 이름은 development.conf
이고 mime.types
- 파일입니다.NGINX가 ./logs/error.log를 기본값으로 사용하려는 이유는 무엇입니까?
내 로그를 RAILS_ROOT/log
- 디렉토리에 넣으려고합니다.
이
은 내development.conf
:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# main access log
access_log log/nginx.access.log;
# main error log
error_log log/nginx.error.log debug;
sendfile on;
keepalive_timeout 65;
server {
listen 9001; #omg!
server_name local.woman.dk;
rewrite ^/(.*)/$ /$1 last;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_max_temp_file_size 0;
location/{
ssi on;
proxy_pass http://127.0.0.1:3000;
}
}
}
내가이 명령을 내 RAILS_ROOT에서의 nginx를 시작하고있다 :
nginx -p . -c config/nginx/development.conf
그리고 다음과 같은 오류 얻을 :
nginx: [alert] could not open error log file: open() "./logs/error.log" failed (2: No such file or directory)
내 버전 이 :
[(master)]=> nginx -v
nginx version: nginx/1.2.4
뭐가 잘못 되었나요?
이- 기본값은 디버그 로깅이 작동하려면, nginx를가 무슨 일이야
--with-debug.`로 구축 될 필요가 있다고 error_log logs/error.log error;
그리고 디버그로 어떻게 컴파일합니까? nginx를 다시 설치/재설치해야합니까? – octohedron