Nginx change /phpmyadmin directory Nginx change /phpmyadmin directory nginx nginx

Nginx change /phpmyadmin directory


On a Ubuntu server i've used the following setup to make phpMyAdmin available under /pma for several Nginx sites.

/etc/phpmyadmin/nginx-php5-fpm.conf

location /pma {    alias /usr/share/phpmyadmin/;}location ~ ^/pma/(.*\.(js|css|gif|jpg|png))$ {    alias /usr/share/phpmyadmin/$1;}location ~ ^/pma(.+\.php)$ {    alias /usr/share/phpmyadmin$1;    fastcgi_pass unix:/var/run/php-fpm.sock;    fastcgi_index index.php;    charset utf8;    include fastcgi_params;    fastcgi_param DOCUMENT_ROOT /usr/share/phpmyadmin;}

Then in any /etc/nginx/sites-available/* i can enable pma support with this line:

include /etc/phpmyadmin/nginx-php5-fpm.conf;


I think your problem in the second config is the index inside /phpmyadmin replace it with just index index.php

Here's my server's phpmyadmin, but it's configured as a subdomain.

server {    client_header_timeout 0;    server_name phpmyadmin.example.com;    root /var/www/phpmyadmin/;    #replace this with your phpmyadmin location    #like /usr/share/phpmyadmin for example    index           index.php;    access_log /var/log/nginx/phpmyadmin_access_log;    error_log /var/log/nginx/phpmyadmin_error_log;    location ~* \.php$ {        try_files $uri =404;        fastcgi_index   index.php;        fastcgi_pass    unix:/var/run/php5-fpm.sock;        include         fastcgi_params;        client_max_body_size 64m;        client_body_buffer_size 128k;    }    location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {        access_log        off;        log_not_found     off;        expires           360d;    }    location ~ /\.  {        access_log off;        log_not_found off;        deny all;    }}

These three settings are for exporting and importing big files, nginx fails when the exported file is bigger than a certain amount, or if the server takes time to generate the exported sql file.

client_header_timeout 0;client_max_body_size 64m; #change this if ur export is bigger than 64mb.client_body_buffer_size 128k;