# Get nginx version remote

**URL:** <https://www.ruby-forum.com/t/get-nginx-version-remote/215068>\
**Category:** NGINX\
**Created:** [December 21, 2011, 9:49am UTC](https://www.ruby-forum.com/t/get-nginx-version-remote/215068 "2011-12-21T09:49:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 21, 2011, 9:49am UTC](https://www.ruby-forum.com/t/get-nginx-version-remote/215068/1 "2011-12-21T09:49:42Z")

</div>

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:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Arjan\_Filius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Arjan\_Filius](https://www.ruby-forum.com/u/Arjan_Filius)\
**Post date:** [December 21, 2011, 10:00am UTC](https://www.ruby-forum.com/t/get-nginx-version-remote/215068/2 "2011-12-21T10:00:12Z")

</div>

On 21 Dez 2011 08h49 WET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://myhost.com/nginx-version?k=mychosenkey)

Just two examples, plenty of other possible ways to go about it.

— appa

---

<div class="post-metadata">

**Author:** ![Arjan\_Filius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@Arjan\_Filius](https://www.ruby-forum.com/u/Arjan_Filius)\
**Post date:** [December 21, 2011, 10:31am UTC](https://www.ruby-forum.com/t/get-nginx-version-remote/215068/3 "2011-12-21T10:31:07Z")

</div>

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

Server: nginx/1.0.11

A.
