3

didn't think that this is a complex problem but I didn't get it solved.

I'ld love to point www.mydomain.com/phpMyAdmin/ to /var/www/phpMyAdmin/htdocs/

I did this:

server {
    listen 80;
    server_name     localhost;

    location /phpMyAdmin {
            root    /var/www/phpMyAdmin/htdocs/;

            index   index.php;

            #access_log      /var/www/phpMyAdmin/logs/access.log;
            #error_log       /var/www/phpMyAdmin/logs/error.log;
    }

    location ~ \.php$ {
            include fastcgi_params;
            try_files $uri =404;
            fastcgi_pass unix:/var/www/sockets/www.socket;
    }
}

But the result when calling www.mydomain.com/phpMyAdmin ist that it tries to call

/var/www/phpMyAdmin/htdocs/phpMyAdmin/index.php

Anyone could help me?

PascalTurbo
  • 2,189
  • 3
  • 24
  • 41

1 Answers1

0

That is very easy.

Nginx appends $uri of location to the root directive ($document_root variable) .
You can use alias directive instead:

location /phpMyAdmin {
 index   index.php;
 alias    /var/www/phpMyAdmin/htdocs/;
 access_log      /var/www/phpMyAdmin/logs/access.log;
 error_log       /var/www/phpMyAdmin/logs/error.log;
}

But, phpMyAdmin will NOT work, because, it is not a static file.
I believe, you need to specify location for php inside /phpmyadmin:
location ~ /phpMyAdmin/\.php$

antonbormotov
  • 1,821
  • 2
  • 20
  • 32