title: How to remove both .php and .html extensions from url using NGINX?
body: <p>I want my nginx make display all url's clean. </p>
  
  <ul>
  <li><a href="http://www.mydomain.com/indexhtml.html" rel="noreferrer">http://www.mydomain.com/indexhtml.html</a> as <a href="http://www.mydomain.com/indexhtml" rel="noreferrer">http://www.mydomain.com/indexhtml</a> </li>
  <li><a href="http://www.mydomain.com/indexphp.php" rel="noreferrer">http://www.mydomain.com/indexphp.php</a> as <a href="http://www.mydomain.com/indexphp" rel="noreferrer">http://www.mydomain.com/indexphp</a></li>
  </ul>
  
  <p>With some research I've made the first case to work. It`s done by following configuration:</p>
  
  <pre><code>location / {
      root   html;
      index  index.html index.htm index.php;
      try_files $uri.html $uri/ =404; 
  }
  </code></pre>
  
  <p>It works for indexhtml.html displaying as indexhtml, but nothing happens with .php. If I change $uri.html to $uri.php, it works neither for .html, neither .php. I`ve tried to put something similar in php location but without any success.</p>
  
  <p>Any advices?</p>