Nginx error : open failed 2 no such file or directory

2014-10-09 Thread Mapper Uno
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 director

pid file location even after setting pid directive

2014-08-01 Thread Mapper Uno
Hi, I have added pid directive to nginx config. Pid /home/ubuntu/ngx.pid Nginx -t -c (conf) also succeeds. However when I run nginx, and later try to stop it with nginx -s stop, I get following error: Open failed (2 No such file or directory, /home/ubuntu/install/nginx/logs/nginx.pid Please n

Re: Accessing HTTP request headers in nginx module

2014-03-31 Thread Mapper Uno
I could finally get hold of all the http header fields. A nice link that describes how to access the headers http://wiki.nginx.org/HeadersManagement Thanks for all the replies. Mapper Uno wrote in post #1141373: > Thanks Maxim for your reply. Since I am newbie, please excuse my > questi

Handling large POST data in nginx module

2014-03-30 Thread Mapper Uno
Hi, I wrote an nginx module that handles POST data and returns back the same (something similar to echo_read_request_body in echo module) however, in echo module the input buffer is passed as is to output buffer. However, in my case, I need to copy the incoming buffer and then process it and then

Unable to get large POST data in post handler nginx module

2014-03-30 Thread Mapper Uno
Hi, I am writing an nginx module that processes POST requests. For small data typically less than 1000 bytes, the module successfully receives data. However, for larger data > 1000 bytes or so, I get NULL. ngx_http_request_t *r; ngx_chain_t *ch = r->request_body->bufs; // > For l

Re: Accessing HTTP request headers in nginx module

2014-03-28 Thread Mapper Uno
uld you please explain Maxim Dounin wrote in post #1141328: > Hello! > > On Fri, Mar 28, 2014 at 01:06:00AM +0100, Mapper Uno wrote: > >> indicates that these are not "custom" headers. With reference to my >> above example, how can I access my custom header "OP

Re: Accessing HTTP request headers in nginx module

2014-03-27 Thread Mapper Uno
Thanks for reply. However, I am still not clear how to access the "custom" headers in module handler. Pls see my comments inline. B.R. wrote in post #1141281: > In nginx, you have the http_ embedded variable in the core > module >

Accessing HTTP request headers in nginx module

2014-03-27 Thread Mapper Uno
Hi, I am writing a small nginx module that needs to get/parse HTTP request header and depending on it's value, needs to be do something. ex. curl -X POST -H "OPERATION: add" http://localhost:80/calc to add 2 numbers ex. curl -X POST -H "OPERATION: divide" http://localhost:80/calc to divide 2

Nginx POST handler module caching response

2014-03-25 Thread Mapper Uno
Hi, I have written a small nginx module that processes POST request and sends back in response the same data that is received in POST request. I am testing this with curl utility and closely monitoring nginx log which is set to debug level. (My module's server is listening on port 9000) # curl -