Re: nginx rewrites $request_method on error

2014-05-19 Thread Yichun Zhang (agentzh)
Hello! On Mon, May 19, 2014 at 4:33 AM, Maxim Dounin wrote: > First of all, I think that people should think before specifying > error processing, especially complex error processing. > Unfortunately we cannot control what the users *think* :) Many users just try things away according to their in

Re: nginx rewrites $request_method on error

2014-05-19 Thread Maxim Dounin
Hello! On Fri, May 16, 2014 at 01:25:57PM -0700, Yichun Zhang (agentzh) wrote: > Hello! > > On Thu, May 15, 2014 at 11:56 PM, kay wrote: > > Don't you think this is a bug? > > > > I think the NGINX core should prevent bad things from happen when > > 1. the user configures complicated things in

Re: nginx rewrites $request_method on error

2014-05-16 Thread Yichun Zhang (agentzh)
Hello! On Thu, May 15, 2014 at 11:56 PM, kay wrote: > Don't you think this is a bug? > I think the NGINX core should prevent bad things from happen when 1. the user configures complicated things in his error_page targets, and 2. the error page is initiated by nginx too early in the request proce

Re: nginx rewrites $request_method on error

2014-05-16 Thread kay
I mean that I know how to avoid these errors, but I think that a better way to fix the issue is to fix it in low level. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,250145#msg-250145 ___ nginx mailing list nginx@nginx.org http://mail

Re: nginx rewrites $request_method on error

2014-05-15 Thread kay
Don't you think this is a bug? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,250144#msg-250144 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: nginx rewrites $request_method on error

2014-05-15 Thread Yichun Zhang (agentzh)
Hello! On Wed, May 14, 2014 at 11:19 PM, kay wrote: > http { > error_page 405 /error.html; > error_page 400 /error.html; > error_page 403 /error.html; > Okay, I can reproduce your request hang on my side now and I see what is going on here. Basically the 405 error is thro

Re: nginx rewrites $request_method on error

2014-05-14 Thread kay
Here is nginx version: nginx -V nginx version: nginx/1.6.0 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) TLS SNI support enabled configure arguments: --add-module=ngx_devel_kit-0.2.19 --add-module=lua-nginx-module-0.9.7 --add-module=memc-nginx-module-0.14 --user=apache --group=apache --prefi

Re: nginx rewrites $request_method on error

2014-05-14 Thread Yichun Zhang (agentzh)
Hello! On Tue, May 13, 2014 at 11:52 PM, kay wrote: > This config produces the same nginx hang. > > server { > listen 80; > location / { > access_by_lua ' > local res = ngx.location.capture("/memc?cmd=get&key=test") > return > '; > root /etc/

Re: nginx rewrites $request_method on error

2014-05-13 Thread kay
Yichun Zhang (agentzh) Wrote: --- > Hello! > > On Wed, May 7, 2014 at 8:59 PM, kay wrote: > >> 1. It is not recommended to use the rewrite_by_lua directive > directly > > > > You can do the same with access_by_lua > > > > Please do not cut my or

Re: nginx rewrites $request_method on error

2014-05-08 Thread Yichun Zhang (agentzh)
Hello! On Wed, May 7, 2014 at 8:59 PM, kay wrote: >> 1. It is not recommended to use the rewrite_by_lua directive directly > > You can do the same with access_by_lua > Please do not cut my original sentence and just pick the first half. The full sentence is "it is not recommended to use the rewri

Re: nginx rewrites $request_method on error

2014-05-07 Thread kay
> 1. It is not recommended to use the rewrite_by_lua directive directly You can do the same with access_by_lua > Finally, ensure your version of ngx_lua, ngx_memc, and the nginx core are recent enough. They are recent. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,249921#msg-

Re: nginx rewrites $request_method on error

2014-05-07 Thread Yichun Zhang (agentzh)
Hello! On Tue, May 6, 2014 at 11:30 PM, kay wrote: > Sure, you can use nginx.conf from my previous message and this server > config: > I've noticed 2 obvious mistakes in your config. See blow. > server { > listen 80; > > rewrite_by_lua ' > local res = ngx.location.capture("/memc?cmd=ge

Re: nginx rewrites $request_method on error

2014-05-06 Thread kay
Sure, you can use nginx.conf from my previous message and this server config: server { listen 80; rewrite_by_lua ' local res = ngx.location.capture("/memc?cmd=get&key=test") ngx.say(res.body) '; location / { root /etc/nginx/www; } location /memc { internal;

Re: nginx rewrites $request_method on error

2014-05-06 Thread Yichun Zhang (agentzh)
Hello! On Tue, May 6, 2014 at 2:58 AM, kay wrote: > Actually I suppose that this is a bug, as it is not possible to make filter > by $request_method > > Also some external modules like > https://github.com/openresty/memc-nginx-module have strange behavior when > client passes TRACE and nginx gets

Re: nginx rewrites $request_method on error

2014-05-06 Thread kay
Actually I suppose that this is a bug, as it is not possible to make filter by $request_method Also some external modules like https://github.com/openresty/memc-nginx-module have strange behavior when client passes TRACE and nginx gets GET. Posted at Nginx Forum: http://forum.nginx.org/read.php?

Re: nginx rewrites $request_method on error

2014-04-30 Thread Maxim Dounin
Hello! On Wed, Apr 30, 2014 at 03:04:11AM -0400, kay wrote: [...] > So it seems that error_page 405 /error.html rewrites $request_method Yes, redirection a request to an error page implies changing the request method to GET (unless it's HEAD). It's required to properly return error page. Mu

Re: nginx rewrites $request_method on error

2014-04-30 Thread kay
nginx from official repository: nginx -V nginx version: nginx/1.6.0 built by gcc 4.7.2 (Debian 4.7.2-5) TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/

nginx rewrites $request_method on error

2014-04-30 Thread kay
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid/var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; # LET'S LOG $request_method # log_format main '$r