404 on localized entries - Nginx I'm stucked with a 404 error on all my localized sub-directories.
It works fine for the homepage ( es. domain.com/es, domain.com/it ). Also urls in the main directory are behaving correctly. Example:
domain.com/products is fine domain.com/es/products is not.

I'm running Craft Pro on Nginx. Here is my general.php:

'siteUrl' =&gt; array(
        'en' =&gt; 'http://129.0.1.67/',
        'en_us' =&gt; 'http://129.0.1.67/us/',
        'de' =&gt; 'http://129.0.1.67/de/',
        'fr' =&gt; 'http://129.0.1.67/fr/',
        'it' =&gt; 'http://129.0.1.67/it/',
        'es' =&gt; 'http://129.0.1.67/es/',
        'tr' =&gt; 'http://129.0.1.67/tr/',
        'ru' =&gt; 'http://129.0.1.67/ru/',
        'zh' =&gt; 'http://129.0.1.67/zh/'
)


Here is my index.php file for subfloders

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

/**
 * Define Craft locales
 */
define('CRAFT_LOCALE', 'es');

/**
 * Define Craft Templates Path
 */
 $templatePath = '../../craft/templates';
define('CRAFT_TEMPLATES_PATH', $templatePath);


I'm assuming that my problem is with my NGINX configuration but I'm not confident with it.

    root /var/www/app;


    location / {
            try_files $uri $uri/ @rewrites;
    }

    location @rewrites {
            rewrite ^(.*) /index.php?p=$1 last;
    }


    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
    }


Here is a Craft log in the browser console:

[12:46:33.764][error][exception.Craft\HttpException.404]
Craft\HttpException in /var/www/craft/app/controllers/TemplatesController.php:72
Stack trace:
#0 [internal function]: Craft\TemplatesController-&gt;actionRender('es/oil-news/pro...', Array)
#1 /var/www/craft/app/framework/web/actions/CAction.php(109): ReflectionMethod-&gt;invokeArgs(Object(Craft\TemplatesController), Array)
#2 /var/www/craft/app/framework/web/actions/CInlineAction.php(47): CAction-&gt;runWithParamsInternal(Object(Craft\TemplatesController), Object(ReflectionMethod), Array)
#3 /var/www/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams(Array)
#4 /var/www/craft/app/framework/web/CController.php(286): CController-&gt;runAction(Object(CInlineAction))
#5 /var/www/craft/app/framework/web/CController.php(265): CController-&gt;runActionWithFilters(Object(CInlineAction), Array)
#6 /var/www/craft/app/framework/web/CWebApplication.php(282): CController-&gt;run('render')
#7 /var/www/craft/app/framework/web/CWebApplication.php(141): CWebApplication-&gt;runController('templates/rende...')
#8 /var/www/craft/app/etc/web/WebApp.php(290): CWebApplication-&gt;processRequest()
#9 /var/www/craft/app/framework/base/CApplication.php(185): Craft\WebApp-&gt;processRequest()
#10 /var/www/craft/app/index.php(62): CApplication-&gt;run()
#11 /var/www/app/index.php(67): require_once('/var/www/craft/...')
#12 {main}
REQUEST_URI=/es/oil-news/prova
Seems like I needed a bit more configurations for NGINX, something like

location /es/ {
    try_files $uri $uri/ @esrewrites;
}

location @esrewrites {
    rewrite ^/es/(.*)$ /es/index.php?p=$1? last;
}


for each locale. 
Source: https://gist.github.com/cmalven/5cc95cce4e495d3a11df

Still not sure if there is a better option that avoids hard coding locales in NGINX config file.