# Possible nginx security enhancement

**URL:** <https://www.ruby-forum.com/t/possible-nginx-security-enhancement/210032>\
**Category:** NGINX\
**Created:** [July 28, 2011, 8:00pm UTC](https://www.ruby-forum.com/t/possible-nginx-security-enhancement/210032 "2011-07-28T20:00:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [July 28, 2011, 8:00pm UTC](https://www.ruby-forum.com/t/possible-nginx-security-enhancement/210032/1 "2011-07-28T20:00:56Z")

</div>

Hallo all,

I have been using nginx very satisfactorily for a few years by now.

Recently I noticed I was having problems with my sites, and finally  
traced  
them back to an nginx problem.

I use nginx on a gentoo linux system, and when nginx is emerged the  
necessary directories are created in /var/tmp:

nginx - client  
- fastcgi  
- proxy  
- scgi  
- uwsgi

What happens is that, if /var/tmp/nginx directory is missing, nginx will  
not start at all. However, if subdirectories have been cancelled, nginx  
will start normally, but sites won’t work properly ( things like  
uploading  
attachments for squirrelmail or changing theme preferences in drupal  
etc.  
) In my case, the /var/tmp/nginx subdirectories had been cancelled (my  
fault)

I appreciate the fact that nginx checks the conf file before starting or  
restarting - helps avoiding a mess when you’ve edited a file and  
forgotten  
an extra } somewhere.

Wouldn’t it be good if it also checked for the proper directories to  
exist? Or even created them if they didn’t exist?

/var/tmp is a directory which may be cleaned up periodically to avoid  
useless clutter and this sometimes leads to weird mistakes.

Just a suggestion.

Michele

---

<div class="post-metadata">

**Author:** ![Michele\_Alzetta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@Michele\_Alzetta](https://www.ruby-forum.com/u/Michele_Alzetta)\
**Post date:** [July 28, 2011, 8:22pm UTC](https://www.ruby-forum.com/t/possible-nginx-security-enhancement/210032/2 "2011-07-28T20:22:35Z")

</div>

On Thu, Jul 28, 2011 at 07:59:14PM +0200, Michele Alzetta wrote:

> nginx - client  
> fault)
> 
> Just a suggestion.

I do not think that /var/tmp/nginx is good place for nginx temp files.  
nginx may relink temporary files to permanent storage, so these  
directories  
are better:

/var/nginx/fastcgi\_cache  
fastcgi\_temp  
…

–  
Igor S.
