Support

Forums

Contact Me

Best nginx configuration for Joomla

Nginx-logo

nginx (pronounced “engine-x”) is an open source Web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP protocols, with a strong focus on high concurrency, performance and low memory usage. It is licensed under a BSD-like license and it runs on Unix, Linux, BSD variants, Mac OS X, Solaris, AIX and Microsoft Windows [WikiPedia]

These are my reusable settings for any Joomla hosting, these are the most secure, and fastest settings to the best of my knowledge.

Configuration files are provided using Gist  and are CONSTANTLY updated for added security and speed. Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository. I recommend you to starred them to stay up to date.

Joomla.conf for nginx

Create a new directory nginx/conf to be able to place reusable nginx settings:

mkdir -p /etc/nginx/conf

vi /etc/nginx/conf/joomla.conf

Edit or create joomla.conf, you can find the latest joomla.conf documented version in one of my Gist at https://gist.github.com/1620307

Adding a new Joomla Site to nginx

Create required directory anywhere on your disk, here is an example with a domain www.example.com

mkdir -p /var/www/vhosts/example.com/httpdocs
mkdir -p /var/www/vhosts/example.com/logs

Set the right permission to the user and group you have defined in nginx.conf

chown -fR www-data:www-data /var/www/vhosts/example.com/httpdocs

Copy the nginx template and adapt to your liking

cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example
vi /etc/nginx/sites-available/example

Edit or create example, you can find the latest file example documented version in one of my Gist at https://gist.github.com/1620307

this file include Joomla.conf to avoid duplicating nginx settings

Activate the new domain

ln -s /etc/nginx/sites-available/example /etc/nginx/sites-enabled/example
service nginx restart
You might also like:
cedphotofeed 2.6.3 for joomla J2.5 and J3.0 released
9 days ago
cedphotofeed 2.6.3 for joomla J2.5 and J3.0 released
This extension for Joomla  2.5 and Joomla 3.0 allow you to inline a set of images from your f
Add2Home 1.7.1 for J3.0 Released
77 days ago
Add2Home 1.7.1 for J3.0 Released
This small plugin for Joomla! add a message inviting iPhone/iPad users to add the web application
cedSmugmug 2.6.2  for joomla J2.5 and J3.0 released
79 days ago
cedSmugmug 2.6.2 for joomla J2.5 and J3.0 released
CedSmugmug  has been updated to version 2.6.2 and correct one bugs and contains some nice fea
cedphotofeed 2.6.2 for joomla J2.5 and J3.0 released
79 days ago
cedphotofeed 2.6.2 for joomla J2.5 and J3.0 released
This extension for Joomla  2.5 and Joomla 3.0 allow you to inline a set of images from your f
cedPhotofeed 2.6.1 for J2.5 Released
86 days ago
cedPhotofeed 2.6.1 for J2.5 Released
This extension for Joomla! 2.5 allow you to inline a set of images from your favorite online galle
Schema Validation for Joomla 2.5 Extensions
93 days ago
Schema Validation for Joomla 2.5 Extensions
I’ve created from scratch, all Joomla extensions XSD. Without them, Joomla accept any entry in
blog comments powered by Disqus

Donations

Thank You for supporting my work