Welcome! Log In Create A New Profile

Advanced

RE: Feedback on my module

Sirsiwal, Umesh
April 02, 2011 12:32AM
agentzh,
I knew I should have tested this sample before posting it :(

Not a Lua expert yet.
-Umesh
________________________________________
From: agentzh [agentzh@gmail.com]
Sent: Friday, April 01, 2011 11:50 PM
To: nginx-devel@nginx.org
Cc: Sirsiwal, Umesh
Subject: Re: Feedback on my module

On Fri, Apr 1, 2011 at 10:44 PM, Umesh Sirsiwal <usirsiwal@verivue.com> wrote:
> Hey Tarek,
> You can use combination of nginx_memc (http://wiki.nginx.org/HttpMemcModule)
> and nginx_lua (https://github.com/chaoslawful/lua-nginx-module) to achieve
> the same result.
>
> Here is an example:
>

Well, there's just some small grammatical errors in the code sample ;)

> location /blah {
> rewrite_by_lua '
> if($http_x_target_service == nil) then

if ngx.var.http_x_target_service == nil then

> return
> end
> local res = ngx.location.capture("/memc/$http_x_target_service")
>
> if res.status != ngx.HTTP_OK then

if res.status ~= ngx.HTTP_OK then

> ngx.exit(ngx.HTTP_SERVICE_UNAVAILABLE)
> return
> end
> if(res.body != "up") then

if res.body ~= "up" then

> ngx.exit(ngx.HTTP_SERVICE_UNAVAILABLE)
> return

There's no effect to explicitly "return" when ngx.exit() is used
because ngx.exit() will never return back ;)

> end
> ';
>

Anyway, thank you for your code sample, Umesh :)

Cheers,
-agentzh

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Feedback on my module

Tarek Ziade 1708 April 01, 2011 08:08AM

Re: Feedback on my module

Umesh Sirsiwal 477 April 01, 2011 10:46AM

Re: Feedback on my module

Tarek Ziade 502 April 01, 2011 12:30PM

Re: Feedback on my module

agentzh 459 April 01, 2011 11:52PM

RE: Feedback on my module

Sirsiwal, Umesh 673 April 02, 2011 12:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready