# Sort of nginx specific

**URL:** <https://www.ruby-forum.com/t/sort-of-nginx-specific/195946>\
**Category:** NGINX\
**Created:** [October 3, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/sort-of-nginx-specific/195946 "2010-10-03T19:41:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iberci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@iberci](https://www.ruby-forum.com/u/iberci)\
**Post date:** [October 3, 2010, 7:41pm UTC](https://www.ruby-forum.com/t/sort-of-nginx-specific/195946/1 "2010-10-03T19:41:21Z")

</div>

Hi All,

I’m setting up Nagios to run thorugh Nginx. I have the CGI wrapper  
working  
(yey). However, some nagios web based functions require access to a  
nagios  
command file (a pipe) in the nagios /var/rw directory.

When the nagios service starts, it creates a “nagios.cmd” pipe file in  
the  
rw directory.

When trying to access that web file through the web interface, there’s a  
permission issue. However, if I set the nagios.cmd file to have 777  
permissions, it works fine.

The problem is that when the nagios service is restarted, the nagios.cmd  
file is recreated and no longer has the 777 permissions.

I am running the nagios service and the Nginx web server under the same  
user  
and group.

The /nagios/ directory is accessed through an alias configuration, so  
maybe  
that has something to do with it?

Regardless, for some reason, the user that Nginx is trying to access the  
nagios.cmd file is being denied.

Is anyone familiar with this particular issue? Just thought I’d ask  
this  
group. I have posted this question at the Nagios group and was told to  
look  
at:  
[http://nagios.sourceforge.net/docs/2\_0/commandfile.html](http://nagios.sourceforge.net/docs/2_0/commandfile.html)

Which I followed to a tee, but no luck.

Just thought I’d ask this group… 🙂

Thanks

---

<div class="post-metadata">

**Author:** ![iberci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@iberci](https://www.ruby-forum.com/u/iberci)\
**Post date:** [October 4, 2010, 1:21pm UTC](https://www.ruby-forum.com/t/sort-of-nginx-specific/195946/2 "2010-10-04T13:21:43Z")

</div>

Hello!

On Sun, Oct 03, 2010 at 01:39:59PM -0400, Ilan B. wrote:

> permission issue. However, if I set the nagios.cmd file to have 777  
> permissions, it works fine.
> 
> The problem is that when the nagios service is restarted, the nagios.cmd  
> file is recreated and no longer has the 777 permissions.
> 
> I am running the nagios service and the Nginx web server under the same user  
> and group.

nginx user doesn’t matter as nginx only talks to backend (i.e.  
your CGI wrapper). It’s your CGI wrapper user/group which  
matters.

Maxim D.

---

<div class="post-metadata">

**Author:** ![iberci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@iberci](https://www.ruby-forum.com/u/iberci)\
**Post date:** [October 4, 2010, 2:12pm UTC](https://www.ruby-forum.com/t/sort-of-nginx-specific/195946/3 "2010-10-04T14:12:38Z")

</div>

That’s a valid point and I’m pretty sure that’s exactly what it was as  
once  
I fixed that issue, it worked.

Thanks!
