initial commit
This commit is contained in:
11
doc/examples/perl/site/http-env-perl.conf
Normal file
11
doc/examples/perl/site/http-env-perl.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
perl_require ngx_env.pm;
|
||||
server {
|
||||
listen 8080;
|
||||
|
||||
location / { return 204; }
|
||||
|
||||
location = /env
|
||||
{
|
||||
perl ngx_env::report;
|
||||
}
|
||||
}
|
22
doc/examples/perl/site/ngx_env.pm
Normal file
22
doc/examples/perl/site/ngx_env.pm
Normal file
@@ -0,0 +1,22 @@
|
||||
package ngx_env;
|
||||
|
||||
use nginx;
|
||||
|
||||
sub report {
|
||||
my $r = shift;
|
||||
|
||||
my $s = "";
|
||||
for (sort keys %ENV) {
|
||||
$s = $s . "$_=$ENV{$_}\n";
|
||||
}
|
||||
|
||||
$r->discard_request_body;
|
||||
$r->send_http_header;
|
||||
$r->print($s);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
Reference in New Issue
Block a user