title: Nginx - Changing the server root make location root not working
body: <p>I'm trying to setup phpmyadmin on my domain, and for some reason, I can't have the server root I want.</p>
  
  <p>This doesn't work (404 on example.com/phpmyadmin without anything in the logs):</p>
  
  <pre><code>server {
      listen 80 default_server;
      listen [::]:80 default_server ipv6only=on;
      client_max_body_size 300m;
      root /var/www/html;
      index index.php index.html index.htm;
  
      server_name example.com;
  
      location / {
          try_files $uri $uri/ =404;
      }
  
      location /phpmyadmin/ {
          root /var/www/admin/;
      }
  
      error_page 404 /404.html;
      error_page 500 502 503 504 /50x.html;
      location = /50x.html {
          root /usr/share/nginx/html;
      }
  
      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;
      }
  }
  </code></pre>
  
  <p>But if I change the server root to /usr/share/nginx/html it works...</p>
  
  <p>Do you have any idea of what is happening?
  Thank you for reading me.</p>