# Accessing binding nginx via Lua

**URL:** <https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423>\
**Category:** NGINX\
**Created:** [October 15, 2013, 1:42pm UTC](https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423 "2013-10-15T13:42:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [October 15, 2013, 1:42pm UTC](https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423/1 "2013-10-15T13:42:33Z")

</div>

Would it be possible (and how) to access the bindings inside nginx via  
Lua?  
for an experiment I’d like to change the listening port of a running  
nginx  
process.

Posted at Nginx Forum:

> **[Accessing binding nginx via Lua](https://forum.nginx.org/read.php?2,243705,243705#msg-243705)**
>
> Would it be possible (and how) to access the bindings inside nginx via Lua? for an experiment I'd like to change the listening port of a running nginx process.

---

<div class="post-metadata">

**Author:** ![itpp2012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f05b48/32.png) [@itpp2012](https://www.ruby-forum.com/u/itpp2012)\
**Post date:** [October 15, 2013, 3:30pm UTC](https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423/2 "2013-10-15T15:30:05Z")

</div>

Hello!

On Tue, Oct 15, 2013 at 07:41:45AM -0400, itpp2012 wrote:

> Would it be possible (and how) to access the bindings inside nginx via Lua?  
> for an experiment I’d like to change the listening port of a running nginx  
> process.

I can’t really speak of Lua, but given the nginx architecture it’s  
highly unlikely to be ever possible. Listen sockets are created  
by master process and inherited by workers. In most cases,  
workers just can’t open listening sockets due to security  
restrictions.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![itpp2012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f05b48/32.png) [@itpp2012](https://www.ruby-forum.com/u/itpp2012)\
**Post date:** [October 15, 2013, 4:11pm UTC](https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423/3 "2013-10-15T16:11:35Z")

</div>

## Maxim D. Wrote:

> In most cases, workers just can’t open listening sockets due to security  
> restrictions.

I’d still like to try, can you point me where a worker binds to the  
inherited values?

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,243705,243718#msg-243718](http://forum.nginx.org/read.php?2,243705,243718#msg-243718)

---

<div class="post-metadata">

**Author:** ![itpp2012](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/f05b48/32.png) [@itpp2012](https://www.ruby-forum.com/u/itpp2012)\
**Post date:** [October 15, 2013, 4:38pm UTC](https://www.ruby-forum.com/t/accessing-binding-nginx-via-lua/246423/4 "2013-10-15T16:38:28Z")

</div>

Hello!

On Tue, Oct 15, 2013 at 10:11:10AM -0400, itpp2012 wrote:

> ## Maxim D. Wrote:
> 
> > In most cases, workers just can’t open listening sockets due to security  
> > restrictions.
> 
> I’d still like to try, can you point me where a worker binds to the  
> inherited values?

It just have them in the cycle-\>listening array.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**
