1

nginx is searching for phpMyAdmin in the wrong location

my nginx config:


server {
        listen 80;
        listen [::]:80;

        access_log /var/log/nginx/reverse-access.log;
        error_log /var/log/nginx/reverse-error.log;

        root /var/www/MY_DOMAIN/html;
        index index.html index.html index.php;
        server_name MY_DOMAIN www.MY_DOMAIN.com;

        location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
     }

    location ~ /\.ht {
        deny all;
    }

        location /APP_LOCATION {
         proxy_pass http://localhost:3000;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection 'upgrade';
         proxy_set_header Host $host;
         proxy_cache_bypass $http_upgrade;
  }
}

I did a symlink from /usr/share/phpmyadmin to /var/www/MY_DOMAIN/html/phpmyadmin.

But nginx is still looking in the default location for phpMyAdmin

Error logs:

2021/08/27 13:24:41 [error] 1114474#1114474: *2 "/usr/share/nginx/html/phpmyadmin/index.html" is not found (2: No such file or directory), client: xxx.xx.x.xxx, server: , request: "GET /phpmyadmin/ HTTP/1.1", host: "MY_DOMAIN.com"

Glorfindel
  • 1,213
  • 4
  • 15
  • 22
Vlad
  • 11
  • 1

0 Answers0