Get nginx version remote

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) ?

Thanks in advance.


Arjan Filius
mailto:[email protected]

On 21 Dez 2011 08h49 WET, [email protected] 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

Actually, by default (at least with the debian packages from
nginx.org) it’s in the Server header:

Server: nginx/1.0.11

A.