get nginx version remote
António P. P. Almeida
appa at perusio.net
Wed Dec 21 08:58:03 UTC 2011
On 21 Dez 2011 08h49 WET, iafilius at xs4all.nl wrote:
> Hello,
>
> we use nginx as reverse proxy for some websites, and we'd like to
> get the nginx version for administration purposes.
>
> Is there as way to get nginx's version remote, for example like the
> same way as the HttpStubStatusModule (restricted url/access) ?
map $remote_addr $can_have_version {
default 0;
192.168.96.0/24 1; # put your allowed IP list here
}
location /nginx-version {
if ($can_have_version) {
return 200 "nginx version: $nginx_version\n";
}
return 403;
}
This is one way another would be using a key with an arg like this:
location /nginx-version {
if ($arg_k = mychosenkey) {
return 200 "nginx version: $nginx_version\n";
}
return 403;
}
You would request the version with:
http://myhost.com/nginx-version?k=mychosenkey
Just two examples, plenty of other possible ways to go about it.
--- appa
More information about the nginx
mailing list