Tag Archives: nginx

Changing Nginx Server Name on its HTTP Header

Nginx by default showing its name and also its version depending the configuration.

To change this name we have to edit the source file and recompile Nginx.

Open the file: <nginx source>/src/http/ngx_http_header_filter_module.c

Look for line 49:

and change it to:

Now you need to compile Nginx and restart it to make the changes take effect.

Can’t Create or Write on /tmp With Error: No space left on device

I just got a problem with writing error on /tmp on one of my client server. The strange problem is that df -h command shows that /tmp only 35% used so there should be plenty of space to write on.

After some investigation it seems that the /tmp partition hit the number of files limit due to caching files from nginx filling up /tmp, hence it’s not possible to create new files. This problem cause PHP scripts on Cpanel server to show error regarding session as by default Cpanel installation, PHP session are written in /tmp.

Clearing nginx cache files seems to fix the problem. To prevent this from happening again I setup a cron job to clear nginx cache regularly.