NAME
Nginx::Simple - Easy to use interface for "--with-http_perl_module"
SYNOPSIS
nginx.conf:
perl_modules perl;
perl_require Test.pm;
server {
listen 80;
server_name localhost;
location / {
perl Test::handler;
}
}
Test.pm:
package Test;
use Nginx::Simple;
sub init
{
my $self = shift;
$self->header('text/html');
$self->print('rock on!');
$self->log('I found a rabbit...');
my $something = $self->param("here");
$self->print("I found $something...");
return OK;
}
METHODS
$self->server
Returns the nginx server object.
$self->uri
Returns the uri.
$self->filename
Returns the path filename.
$self->request_method
Returns the request_method.
$self->remote_addr
Returns the remote_addr.
$self->print(...)
Output to server.
$self->header(...)
Set output header.
$self->status(...)
Set output status... (200, 404, etc...)
$self->param(...)
Return a parameter passed via CGI--works like CGI::param.
$self->param_hash
Return a friendly hashref of CGI parameters.
Author
Michael J. Flickinger, <mjflick@open-site.org>
Copyright & License
You may distribute under the terms of either the GNU General Public License or the Artistic License.