Nginx error : open failed 2 no such file or directory

Mapper Uno lists at ruby-forum.com
Thu Oct 9 19:28:26 UTC 2014


Hi,

I've written a small nginx module that serves files (with some extra
functionality).  When I access the files through HTTP POST,  I get below
error

[error] 2971#0: *184 open()
"/home/user/build/default/main/nginx/extern-nginx-prefix/nginx/html/1/3/49123876"
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "POST /1/3/49123876 HTTP/1.1", host:
"localhost:9000"

HTTP client uses  URI as  1/3/49123876.  And the call is routed to my
module correctly, however, the nginx log shows  above error. I'm not
sure why is nginx trying to look into
/home/user/build/default/main/nginx/ ....

The module functions correctly and serves the files that are requested,
however, why would I see above error then.

Here is my nginx config:  Please note  'my_pass' directive for my module
that handles the request.


            worker_processes 1;
            master_process off;
            daemon off;
            error_log stderr notice;

            events {
                worker_connections 256;
            }

            http {
                default_type application/octet-stream;
                keepalive_timeout 60;

                client_body_in_single_buffer on;
                client_body_buffer_size 20m;
                client_max_body_size 20m;

                server {
                    listen 9000;
                    server_name localhost;
                    location / {
                        my_pass /home/ubuntu/mugen_config.json;
                    }
                }
           }
-----------------------------------

$ nginx -V
nginx version: ngx_openresty/1.4.3.6
TLS SNI support enabled
configure arguments:
--prefix=/home/ubuntu/install/main/nginx/extern-nginx-prefix/nginx
--with-debug
--add-module=../ngx_devel_kit-0.2.19
--add-module=../echo-nginx-module-0.49
--add-module=../encrypted-session-nginx-module-0.03
--add-module=../auth-request-nginx-module-0.2
--with-ld-opt='-L/home/ubuntu/install/output/lib
-L/usr/local/src/NetBSD/pkgsrc/2013/x86_64-Ubuntu12-Linux-GNU/lib
-lstdc++
-Wl,-rpath,/home/ubuntu/install/output/lib:/usr/local/src/NetBSD/pkgsrc/2013/x86_64-Ubuntu12-Linux-GNU/lib'
--without-http_gzip_module
--without-http_userid_module
--without-http_geo_module
--without-http_map_module
--without-http_uwsgi_module
--without-http_scgi_module
--without-http_memcached_module
--without-http_limit_zone_module
--without-http_empty_gif_module
--without-mail_pop3_module
--without-mail_imap_module
--without-mail_smtp_module
--add-module=/home/ubuntu/install/main/nginx/ngx_http_my_module
--add-module=/home/ubuntu/install/main/nginx/ngx_http_dav_ext_module
--with-http_ssl_module

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list