Welcome! Log In Create A New Profile

Advanced

Re: Catch ALL requests by LUA-script

March 01, 2011 04:53AM
Thanks for your answer.

I just figured out, that "location ~ { ...}" will catch all requests, too ... but i don't know if it's realy that reliable, so the new feature of the nginx-lua-plugin seems to be the perfect solution for my problem (thanks again :-) )

Being able to have direct access by lua in the server/http blocks is great for global actions on the requests.

I just have one more question:

What would be the best phase-handler to check/manipulate http-requests and http-responses?

LUA can work with rewrite (URI transformation on location level), access (access restrictions check), content (generating content for output) and - as i understand - these are processed by nginx in this given order.

Theoretically the best would be to get in directly in the begining with rewrite_by_lua(_file) to be able to check/manipulate request-headers, request-body, etc.?

But nginx will still output it's "default content" after that...
Is there any chance LUA can have access to all of the HTTP-Response, too (especially the headers - the content is not that important at the moment)?

I know that it can be done via ngx.headers["HEADER"] but i don't think this will be possible when still working in the rewrite/access phase?

Hope i don't understand something very wrong there :)

Thanks, Andi
Subject Author Posted

Catch ALL requests by LUA-script

andiL March 01, 2011 02:34AM

Re: Catch ALL requests by LUA-script

agentzh March 01, 2011 03:42AM

Re: Catch ALL requests by LUA-script

andiL March 01, 2011 04:53AM

Re: Catch ALL requests by LUA-script

agentzh March 01, 2011 06:14AM

Re: Catch ALL requests by LUA-script

andiL March 01, 2011 07:52AM

Re: Catch ALL requests by LUA-script

HowToMeetLadies May 02, 2011 12:11AM

Re: Catch ALL requests by LUA-script

agentzh May 03, 2011 10:56PM

Re: Catch ALL requests by LUA-script

HowToMeetLadies May 04, 2011 08:05PM

Re: Catch ALL requests by LUA-script

HowToMeetLadies May 05, 2011 12:29PM

Re: Catch ALL requests by LUA-script

agentzh May 04, 2011 11:22PM

Re: Catch ALL requests by LUA-script

agentzh May 06, 2011 12:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready