bitnami の phpmyadmin をローカルホスト以外から利用する

nginx の phpmyadmin の conf ファイルを修正する

# vim で開く
$ sudo vim /opt/bitnami/nginx/conf/bitnami/phpmyadmin.conf 
  • if 文をコメントアウトする
location ^~ /phpmyadmin {
    alias "/opt/bitnami/phpmyadmin";
    default_type text/html;
#    if ($remote_addr != 127.0.0.1) {
#        return 403 'For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname.';
#    }
    # Avoid absolute redirects when connecting through a SSH tunnel
    absolute_redirect off;
    include "/opt/bitnami/nginx/conf/bitnami/protect-hidden-files.conf";
    include "/opt/bitnami/nginx/conf/bitnami/php-fpm.conf";
}

シェルがあるので、nginxを再起動

 sudo /opt/bitnami/ctlscript.sh restart nginx