0

Hello guys I have a VPS with Ubuntu 20.04.

I have code-server installed and it works properly.

I also have Phpmy admin installed and mariadb, but when i go to my.ip.adress/phpmyadmin i get an 404 error.

I think the problems is that code-server tries to resolve the path or something like this. enter image description here

My configuration looks like this:

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

 root /var/www/html;
    
           
            index index.php index.html index.htm index.nginx-debian.html;
    
            server_name 178.254.34.3;
    
     location / {
               
                    try_files $uri $uri/ =404;
            }
    
   location /phpmyadmin {

                root /usr/share/phpmyadmin;
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
 index index.php index.html index.htm index.nginx-debian.html;
        }



 location ~ \.php$ {

                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }

      
        location ~ /\.ht {
 deny all;
        }
}

Does someone can help me to solve this problem ?

I tried almost everything i could find on the web and it didnt solved the problem.

So I found the problem and it was very obvius at the end. When i first installed code-server i had to create a specifig configuration. so first of all my server was never using the default configuration i posted here. I changed a few things and now it works. At least I am able to see the login page and the info.php file i created. Thanks for your help.

  • Your `location ~ \.php { ... }` block takes precedence over `location /phpmyadmin { ... }` block and intercepts all requests for phpmyadmin php scripts. Check [this](https://stackoverflow.com/questions/62360907/setup-phpmyadmin-inside-website-subdirectory) Q/A, looks like it is exactly your case. – Ivan Shatsky Oct 20 '20 at 14:52
  • I also saw this post before, but i don`t get it to work. I have to be honest and say that i am very new to ubuntu and servers at all, but i tried almost everything and i do not know what to do. – Gianluca Latina Oct 20 '20 at 15:07
  • Ok, add your `snippets/fastcgi-php.conf` contents to your question, I'll look at it. Maybe it is some different from that question OP. In case you are a novice, don't post it into comments! Edit your question instead. – Ivan Shatsky Oct 20 '20 at 15:12

0 Answers0