Nginx で動いているサーバーで、
https://example.com/phpmyadmin
で phpMyAdmin にアクセスできる時に、
https://example.com/secret
で phpMyAdmin にアクセスできるようにする方法です。
https://example.com/phpmyadmin の設定ファイル
location ^~ /phpmyadmin {
root /usr/share;
index index.html index.htm index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
https://example.com/secret の設定ファイル
location /secret {
alias /usr/share/phpmyadmin;
index index.html index.htm index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}