I've got nginx installed on Ubuntu from the repository (v0.7.65), and while with my default site configuration works wonders with WordPress pretty URLs and nginx-compatibility plugin (so far), it doesn't with Joomla!. Here's the configuration:

server {
listen   80 default;
server_name  localhost;

access_log  /var/log/nginx/localhost.access.log;

root   /var/www/nginx-default;

location /wordpress {
    try_files $uri $uri/ @wordpress;

location /joomla {
    try_files $uri $uri/ @joomla;

# Configuración para instalaciones de WordPress
location @wordpress {
    fastcgi_param SCRIPT_FILENAME $document_root/wordpress/index.php;
    include fastcgi_params;

# Configuración para instalaciones de Joomla!
location @joomla {
    fastcgi_param SCRIPT_FILENAME $document_root/joomla/index.php;
    include fastcgi_params;

# pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;


I got it to show me the index, the administrator, and one level below links. That is, if I access /joomla/joomla-overview, it works just nice (with friendly URLs and Apache mod_rewrite enabled in Joomla!), but if I try /joomla/joomla-overview/what-is-new-in-1-5, I get an error.

What do you think is happening here? Do you know other settings to make it work, preferably within the environment I have it now?

Thanks in advance for your support.

PS: Please, I have not found much help relating my issue. I've tried different solutions, to no avail.


I'm not sure if this has been solved but this nginx config works for my joomla installation.

server {
  server_name example.com;
  rewrite ^ http://www.example.com$request_uri permanent;
server {
  server_name www.example.com;
  root /home/public_html/example.com/public;
  error_page   404          /404.html;
  try_files $uri $uri/ /index.php?q=$request_uri;

  index index.php index.htm index.html;
  # serve static files directly
  location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires 30d;
  location 404.html{
    index /404.html;
  location ~* \.php$ {
    # By all means use a different server for the fcgi processes if you need to
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param QUERY_STRING $query_string;
    fastcgi_param REQUEST_METHOD $request_method;
    fastcgi_param CONTENT_TYPE $content_type;
    fastcgi_param CONTENT_LENGTH $content_length;
  location ~ /\.ht {
    deny all;
  • No, it has not been solved yet. I'm not at my machine right now, but I will let you know if it works. Thanks! – Andrés Apr 14 '11 at 20:14
  • It worked wonders, thank you very much! I can finally go back to nginx. – Andrés Apr 21 '11 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.