Hi everyone,
I need to get the hostname by perl. My perl file is as follow:
package testperl;
use nginx;
sub testperl {
$r = shift;
my $url = $r->uri;
$r->discard_request_body;
$r->send_http_header;
$r->print($url);
$r->rflush;
return OK;
}
1;
__END__
But it hadn't hostname. As follow:
$ curl http://localhost/wp-content/themes/twentyten/images/wordpress.png
/wp-content/themes/twentyten/images/wordpress.png
How to get the hostname 'localhost' by perl? Thanks.