I am currently wanting to use NGINX in my Rails setup. I have placed the configuration files in the directory RAILS_ROOT/config/nginx
. Here is my config-file placed named development.conf
and the mime.types
-file.
I am wanting to place my logs in the RAILS_ROOT/log
-directory.
This is my 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;
}
}
}
I am starting NGINX from my RAILS_ROOT with this command:
nginx -p . -c config/nginx/development.conf
And I get the following error:
nginx: [alert] could not open error log file: open() "./logs/error.log" failed (2: No such file or directory)
My version is this:
[(master)]=> nginx -v
nginx version: nginx/1.2.4
Am I doing anything wrong?
http://nginx.org/en/docs/ngx_core_module.html#error_log indicates that:
error_log logs/error.log error;
what's happening is that you're falling through to the default value, I'm not spotting any syntax errors so my guess is that your nginx is not compiled with --with-debug.
you can check that with the nginx -V
(note: that's capital V)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With