title: yii2 using nginx for rewrite url
body: <p>i'm trying to use Nginx to rewrite the url to more user friendly. Removing index.php?r= is success, but the problem is, after i tried to visit other page, it says 404 Not Found. I already add in the <code>config/web</code>  the urlmanager for pretty url but its not working . Can someone help me with this? </p>
  
  <p>i'll try to post the code .</p>
  
  <p>this is the nginx.conf </p>
  
  <pre><code>server {
          listen       88;
          server_name  localhost;
  
  
          location / {
              root   html;
              index index.php index.html index.htm;
              rewrite ^(.*[^/])$ $1/ permanent;
              try_files $uri $uri/ /index.php?r=$args;
          }
  
          error_page   500 502 503 504  /50x.html;
          location = /50x.html {
              root   html;
          }
  
          location ~ .php$ {
              include        fastcgi_params;
              root           html;
              fastcgi_pass   127.0.0.1:9000;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
              include fastcgi.conf;
          }
      }
  </code></pre>
  
  <p>and this is the url manager .</p>
  
  <pre><code>'urlManager' =&gt; [
              'class' =&gt; 'yii\web\UrlManager',
              // Disable index.php
              'showScriptName' =&gt; false,
              // Disable r= routes
              'enablePrettyUrl' =&gt; true,
              'rules' =&gt; array(
                      '&lt;controller:\w+&gt;/&lt;id:\d+&gt;' =&gt; '&lt;controller&gt;/view',
                      '&lt;controller:\w+&gt;/&lt;action:\w+&gt;/&lt;id:\d+&gt;' =&gt; '&lt;controller&gt;/&lt;action&gt;',
                      '&lt;controller:\w+&gt;/&lt;action:\w+&gt;' =&gt; '&lt;controller&gt;/&lt;action&gt;',
              ),
          ],
  </code></pre>
  
  <p>I tried this at my localhost first . </p>
  
  <p>Thank You.</p>