Re: Modify request body before sending to upstream

2015-01-26 Thread abhinanda
Nevermind my previous post. I solved it finally :) location /foo { rewrite_by_lua ' res = ngx.location.capture("/bar", {method = ngx.HTTP_POST, body = "jjj"}) res = ngx.location.capture("/bar", {method = ngx.HTTP_POST, body = res.body}) ngx.print(re

Re: Modify request body before sending to upstream

2015-01-26 Thread abhinanda
Still no luck. Here's my config: upstream wservers { server localhost:8001 max_fails=3 fail_timeout=2s weight=100; server localhost:8002 max_fails=3 fail_timeout=2s weight=100; } server { location /foo { rewrite_by_lua ' ngx.print("yay") '; proxy_pa

Re: Modify request body before sending to upstream

2015-01-26 Thread mex
Hi, > I tried ngx_lua but I might've been doing something wrong. It > complained that I am not allowed to use "proxy_pass" following a > content rewrite. you should read the documentatrion carefully: http://wiki.nginx.org/HttpLuaModule#content_by_lua "Do not use this directive and other conte

Re: Modify request body before sending to upstream

2015-01-26 Thread abhinanda
Thanks! I tried ngx_lua but I might've been doing something wrong. It complained that I am not allowed to use "proxy_pass" following a content rewrite. To make it even simpler, here's a simplified example: - curl -X POST --data "ABCD" localhost:8080 - an NGINX module that calls a custom C functi

Re: Modify request body before sending to upstream

2015-01-26 Thread mex
Hi Abhishek, i'm not 100% sure to understand exactrly what you'd like to do, especially the request-body-manipulation-part. nginx_lua is usually quite handy when you have the need to manipulate a request: http://wiki.nginx.org/HttpLuaModule#access_by_lua you can jump into the acces- or rewrite-

Re: Modify request body before sending to upstream

2015-01-26 Thread abhinanda
Hi, Any info on this? I've been trying a ton of ways to achieve this but it seems like I'm really lost. To repeat with clarity, I need to operate on the request body first, modify it and THEN send it off to upstream servers with the modified content. Any pointers must help. Please :) Abhishek

Re: remote_addr not set using x-real-ip

2015-01-26 Thread Francis Daly
On Mon, Jan 26, 2015 at 09:29:17PM +0800, ron ramos wrote: Hi there, > I would just like to check what mistake i did on implementing real-ip > module. > real_ip_recursive on; That says "tell me the last untrusted address from the list". http://nginx.org/r/real_ip_recursive > set_real

Re: Behavior of security headers

2015-01-26 Thread B.R.
Hello, I guess the 'problem' you are struggling with is one you seem to inflict to yourself. As Valentin explained, and as it is the case with other directives as well ( fastcgi_param immediately comes to my mind), if you

Re: Danger to Nginx from raw unicode in paths?

2015-01-26 Thread Jan-Philip Gehrcke
Hello! In reference to your mail subject, one should note that "raw unicode" does not exist. You should really understand what the term "unicode" means, what the abstract meaning of unicode code points is, and what UTF-8, for example, really is: it is just one of many possible ways to encode

Re: Behavior of security headers

2015-01-26 Thread okamzol
OK, if I understand this right - in my original config I have 2 additional add_header (cache-control) directives in /image location. And these 2 directives prevent that the security headers will be applied on server level? It seems so as this will explain why it works when I apply the sec.headers o

Re: Proxy without buffering

2015-01-26 Thread Pasi Kärkkäinen
On Thu, Jan 22, 2015 at 01:43:10AM -0500, jamesgan wrote: > Hi, all > > Is there any progress in this area so far? It would be great if this > did/will become a standard feature of nginx. > +1 -- Pasi > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,236568,256238#msg-256238 > >

Re: Behavior of security headers

2015-01-26 Thread Valentin V. Bartenev
On Monday 26 January 2015 08:38:08 okamzol wrote: > That's exactly the point - I wanted to set these headers on server level to > become valid for the whole domain and all inherent location blocks. This > avoids the need to repeat all headers in each location... > But are you sure, that you don't

Re: Behavior of security headers

2015-01-26 Thread okamzol
That's exactly the point - I wanted to set these headers on server level to become valid for the whole domain and all inherent location blocks. This avoids the need to repeat all headers in each location... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,256270,256273#msg-256273 ___

Re: Behavior of security headers

2015-01-26 Thread Valentin V. Bartenev
On Monday 26 January 2015 06:19:54 okamzol wrote: > Hi, > > I've a question regarding the different security headers > (Content-Security-Policy, etc.) which can be set via add_header. > In the docs it is mentioned that "add_header" can be set on every level > (http, server, location). So i tried

remote_addr not set using x-real-ip

2015-01-26 Thread ron ramos
Hi All, I would just like to check what mistake i did on implementing real-ip module. Im using nginx 1.6.2 with real_ip_module enabled: nginx -V nginx version: nginx/1.6.2 TLS SNI support enabled configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wfo

Behavior of security headers

2015-01-26 Thread okamzol
Hi, I've a question regarding the different security headers (Content-Security-Policy, etc.) which can be set via add_header. In the docs it is mentioned that "add_header" can be set on every level (http, server, location). So i tried to set some security related header in the server block relate