Nginx: phpmyadmin configuration
by devarni on 13 May 2010, under Howto
This configuration is used to access phpmyadmin as a “subfolder” of the domain like:
http://mysite.com/phpmyadmin
The location will be append to the root! For a similar behaviour like the Apache configuration, you could use the “alias” directive
My phpmyadmin installation is under /usr/share/phpmyadmin, thats why I use /usr/share as the root.
server{
...
location /phpmyadmin{
root /usr/share;
index index.php;
}
location ~ \.php$ {
set $php_root $document_root;
if ($request_uri ~* /phpmyadmin) {
set $php_root /usr/share;
}
fastcgi_pass unix:/tmp/fastcgi.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
English
Deutsch