Phpmyadmin location for nginx
- by multiformeinggno
I installed nginx and phpmyadmin. I set up a domain with these parameters to test phpmyadmin:
server {
listen 80;
server_name domain.com;
root /usr/share/phpmyadmin;
index index.php;
fastcgi_index index.php;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
And everything works properly (if I visit the domain I can login to phpmyadmin). The problem is that it was just for testing phpmyadmin, now I'd like to move this to my 'default' site. But I can't figure out how to have it on /phpmyadmin. Here's the config for the 'default' nginx site (where I'd like to put this /phpmyadmin location):
server {
server_name blabla;
access_log /var/log/nginx/$host.access.log;
error_log /var/log/nginx/error.log;
root /var/www/default;
index index.php index.html;
location / {
try_files $uri $uri/ index.php;
}
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
### NginX Status
location /nginx_status {
stub_status on;
access_log off;
}
### FPM Status
location ~ ^/(status|ping)$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
access_log off;
}
}