location /phpmyadmin {
	alias /usr/share/phpmyadmin;
	index index.php;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
	alias /usr/share/phpmyadmin/$1;
	error_page 404 @apache;
}
location ~ ^/phpmyadmin/(.+\.php)$ {
	alias /usr/share/phpmyadmin/$1;
	fastcgi_pass unix:/var/run/php-fpm.www-data.sock;
	fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME $request_filename;
	include fastcgi_params;
	error_page 502 = @apache;
	error_page 404 = @apache;
}
location @apache {
	error_log /dev/null crit;
	proxy_pass http://127.0.0.1:8080;
	proxy_redirect http://127.0.0.1:8080 /;
	proxy_set_header Host $host;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-Forwarded-Proto $scheme;
}
location ^~ /phpmyadmin/setup {
	deny all;
}
