Locales sub directories on Nginx I'm trying to get a basic locals sub directory system working on Nginx:

/entry - en local.
/fr/entry - french translation.
/it/entry ect..

Having read this knowledge base article and some other forum posts I'm still having difficulties with 404 errors when following them or duplicate '/fr/fr'/entry issues.

Do I need to use duplicate index.php files with locals declared in them if I'm adding url paths in the section admin pages? What about site baseUrls in the config file?

The documentation seems very conflicting in these cases and having tried nearly every possible configuration option my site still won't serve up different locals.

I've had the most luck with this nginx config, together with specifying the local in the section urls in the cms for each section.

server {
    listen 80;
    server_name site.com;
    root /sites/site/public;
    index index.php;
    client_max_body_size 30M;
    location /en/ {
            root /sites/site/public;
            if (!-e $request_filename) {
                    rewrite ^/(.*)$ /index.php?q=$1 last;
            }
    }
    location /ru/ {
            root /sites/site/public/ru;
            if (!-e $request_filename) {
                    rewrite ^/(.*)$ /ru/index.php?q=$1 last;
            }
    }
    location /zh/ {
            root /sites/site/public/zh;
            if (!-e $request_filename) {
                    rewrite ^/(.*)$ /zh/index.php?q=$1 last;
            }
    }
    location / {
            root /sites/site/public;
            if (!-e $request_filename) {
                    rewrite ^/(.*)$ /index.php?q=$1 last;
            }
    }
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_ignore_client_abort on;
            fastcgi_param  SERVER_NAME $http_host;
    }

    location ~ /\.ht {
            deny  all;
    }
}


(each index.php has its own set local var within it like so for fr):

// Path to your craft/ folder
$craftPath = '../../craft';

// Tell Craft to serve the local site
define('CRAFT_LOCALE', 'fr');

// Do not edit below this line


My General config is

&lt;?php

/**
 * General Configuration
 */

return array(
    'siteUrl' =&gt; array(
        'en' =&gt; 'http://www.site.com/',
        'ar' =&gt; 'http://www.site.com/ar/',
        'es' =&gt; 'http://www.site.com/es/',
        'fr' =&gt; 'http://www.site.com/fr/',
        'hu' =&gt; 'http://www.site.com/hu/',
        'it' =&gt; 'http://www.site.com/it/',
        'ru' =&gt; 'http://www.site.com/ru/',
        'zh' =&gt; 'http://www.site.com/zh/',
    ),
    'maxUploadFileSize' =&gt; 2147483647,

    );


This results in the server displaying the correct links to my localised articles in the menu and the en language serves up entries correctly, however other languages are found at /local/local/entitypath not local/entitypath.

Adding site_urls to my config seems to break things more, causing locals to not be served up at all.
When you are following the each-locale-gets-its-own-index.php-file pattern as outlined in the official KB article, “How do I show localized content on the front end?”, then you do not need to include the locale ID in your sections’ Entry URL Format settings.

For example if you have a News section, and you want Arabic entries to get URLs that look like:

http://www.site.com/ar/news/my-entry-slug


Then the Arabic Entry URL Format should just be this:

news/{slug}


not this:

ar/news/{slug}


Everything leading up to “news/{slug}”, including “ar/”, is handled by your Arabic site URL, as defined in your config/general.php file’s siteUrl setting:

'siteUrl' =&gt; array(
    'en' =&gt; 'http://www.site.com/',
    'ar' =&gt; 'http://www.site.com/ar/',
    // ...
),