ScaleScaleScaleScale

Tips / Nginx


Nginx configuration for Joomla

Joomla, along with many other popular CMS like WordPress or Drupal, does have Nginx URL rewriting support, sometimes also called Joomla friendly URLs. This friendly urls can help you out to rank better in search engines, and in this tutorial we will cover the joomla friendly url configuration using Nginx web server.

First, install nginx and configure it. Then add this rules to your server block configuration:

  
location / {
      expires 1d;

        # Enable joomla SEF URL's inside Nginx
        try_files $uri $uri/ /index.php?$args;
    }

So, a full configuration may look like this:

 
server {
...
...
...
location / {
      expires 1d;

        # Enable joomla SEF URL's inside Nginx
        try_files $uri $uri/ /index.php?$args;
    }
...
...
...
}

This configuration does NOT include php-fpm configuration, that is supposed to be already inside your server block configuration.

Restar services to apply changes:

service nginx restart

Whis this little addition, your Joomla Friendly URLs should be working perfectly.

Popular search terms:

  • sef urls nginx
  • joomla conf for nginx
  • joomla nginx
  • nginx config joomla
profile

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking