nginx returns 503 when it gets 403 from haproxy

2016-04-14 Thread CJ Ess
In my environment I have Nginx terminating connections, then sending them to an HAProxy upstream. We've noticed that whenever HAProxy emts a 403 error (Forbidden, in response to our ACL rules), NGINX reports a 503 result (service unavailable) and I believe is logging an "upstream prematurely closed

Re: $ssl_client_verify not working?

2016-04-14 Thread Ramon_Ali
Ahh, as i wasn't seeing the 495 and 496 codes in the logs, only 400 i had assumed that what i needed to re-map. Using 495 and 496 works wonderfully! Thanks Igor. 2016/04/14 21:46:51 [info] 7#7: *1 client SSL certificate verify error: (21:unable to verify the first certificate) while reading cli

Re: (52) Empty reply from server

2016-04-14 Thread Francis Daly
On Thu, Apr 14, 2016 at 11:36:52PM +0530, Pankaj Chaudhary wrote: Hi there, > Actually I have requirement to add value to header and then read same value > like cookies values,URL. > Is any API which I can use for the same. The referenced guides are probably the best starting points. It sounds

Re: $ssl_client_verify not working?

2016-04-14 Thread Igor Sysoev
On 13 Apr 2016, at 03:01, Ramon_Ali wrote: > Hi, i was wanting to return a 403 when invalid client certificate submitted, > however Nginx 1.9.6 returning 400 Bad Request, The SSL Certificate Error. > Seems to return 403 fine when no certificate is submitted, but any clues on > getting it to retur

Re: unknown directive "proxy_ssl"

2016-04-14 Thread Валентин Бартенев
On Thursday 14 April 2016 00:46:05 Jorge Romero wrote: > Hi, > > I’m trying to configure Nginx 1.9.7 as a proxy server. This proxy server > won’t serve as SSL termination for HTTPS requests, for which the proxy_ssl > directive sounds perfect. > > http://nginx.org/en/docs/stream/ngx_stream_proxy

Re: (52) Empty reply from server

2016-04-14 Thread Pankaj Chaudhary
Hi Francis, Thank you for your comments. Actually I have requirement to add value to header and then read same value like cookies values,URL. Is any API which I can use for the same. Please suggest. On 14 Apr 2016 22:25, "Francis Daly" wrote: > On Thu, Apr 14, 2016 at 03:34:40PM +0530, Pankaj Ch

Re: $ssl_client_verify not working?

2016-04-14 Thread Ramon_Ali
Does anyone know of any way to re-map a 400 response code? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,266136,266185#msg-266185 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Redirection problem again in new rules.

2016-04-14 Thread Francis Daly
On Thu, Apr 14, 2016 at 07:03:19PM +0500, Muhammad Yousuf Khan wrote: Hi there, > there are multiple apache redirection rules that were working successfully. > for example something like this > > Redirect 301 //bbb /a/bb.html > > Now i have converted this rule in nginx like this

Re: (52) Empty reply from server

2016-04-14 Thread Francis Daly
On Thu, Apr 14, 2016 at 03:34:40PM +0530, Pankaj Chaudhary wrote: Hi there, > i am trying to set value in header with the help of below code snippet . Web searches for how to write nginx modules tend to point towards "Emiller's Guide" or the "Nginx Development Kit". You may find good background

Re: Redirection problem again in new rules.

2016-04-14 Thread Ph. Gras
Le 14 avr. 2016 à 16:03, Muhammad Yousuf Khan a écrit : > Redirect 301 //bbb /a/bb.html > > Now i have converted this rule in nginx like this > > location // { > rewrite ^(.*)$ //bb.html redirect; > } > You should use break instead redirect : http://n

Redirection problem again in new rules.

2016-04-14 Thread Muhammad Yousuf Khan
Hi, there are multiple apache redirection rules that were working successfully. for example something like this Redirect 301 //bbb /a/bb.html Now i have converted this rule in nginx like this location // { rewrite ^(.*)$ //bb.html redirect; } i also tr

(52) Empty reply from server

2016-04-14 Thread Pankaj Chaudhary
Hi All, i am trying to set value in header with the help of below code snippet . ngx_table_elt_t *h1; h1 = ngx_list_push(&r->headers_out.headers); h1->hash = 1; ngx_str_set(&h1->key, "http_user_agent"); ngx_str_set(&h1->value, "user_agent_value"); if i try to retrieve the same value then

Re: unknown directive "proxy_ssl"

2016-04-14 Thread Francis Daly
On Thu, Apr 14, 2016 at 12:46:05AM -0600, Jorge Romero wrote: Hi there, > I’m trying to configure Nginx 1.9.7 as a proxy server. This proxy server > won’t serve as SSL termination for HTTPS requests, for which the proxy_ssl > directive sounds perfect. I don't understand what your design is, bu