Dead6re wrote:
Hello,
I'm trying to enable phpmyadmin is an directory outside of my public_html folder however I get a problem in which it doesn't load the site.
I'd like the folder to be accessed from the following URLs:
lonelystorm/phpmyadmin
lonelystorm/phpmyadmin/
lonelystorm/phpmyadmin/*
Quote:
location ~ ^/phpmyadmin(|/.*)$ {
auth_basic "Restricted";
auth_basic_user_file /srv/www/lonelystorm.com/htpasswd;
alias /srv/www/lonelystorm.com/phpmyadmin/$1;
index index.php;
fastcgi_param HTTPS on;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/lonelystorm.com/phpmyadmin/$fastcgi_script_name;
include fastcgi_params;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
It seems that you have control of your own domain. In that case a sub-domain set-up is more straightforward. Here is my working example loosely adapted to your domain.
server {
listen 80;
server_name phpmyadmin.lonelystorm.com;
#site-specific
access_log /var/log/nginx/phpmyadmin.access.log;
location / {
root /srv/www/lonelystorm.com/phpmyadmin/;
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
#site-specific
root /var/www/nginx-default;
}
location ~ \.php$ {
#site-specific
root /srv/www/lonelystorm.com/phpmyadmin/;
include fastcgi_params;
#site-specific
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/lonelystorm.com/phpmyadmin/$fastcgi_script_name;
}
}