Debian 9 Stretch nginx phpmyadmin 404 error

batflaps asked:

I installed phpmyadmin on Debian Stretch with nginx, but get 404 when navigating to http://blah.com/phpmyadmin, no errors in the logs. Here’s my default file

vi /etc/nginx/sites-available/default
  server {
  listen 80 default_server;
  listen [::]:80 default_server;
  root /var/www/html;
  server_name _;
  location / {
    try_files $uri $uri/ =404;
  }
  location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  }
  location /phpmyadmin/ {
            alias /usr/share/phpmyadmin/;
            index  index.html index.htm index.php;
            location ~ ^/pmadmin(.+\.php)$ {
                    alias /usr/share/phpmyadmin$1;
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$1;
                    include fastcgi_params;
                    fastcgi_intercept_errors        on;
  }
}

What am I missing?

My answer:


You seem to have misspelled phpmyadmin as pmadmin in the second nested location.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.