同homepage,账户名密码用nginx反代加一个就行了,配置:
location / {
# First att(๐•ᴗ•๐)t to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
auth_basic "Administrator’s Area";
auth_basic_user_file /path/to/.htpasswd;
proxy_pass http://127.0.0.1:948323;
}
if(window.hljsLoader && !document.currentScr(๐•ᴗ•๐).parentNode.hasAttribute('data-s9e-livepreview-onupdate')) {
window.hljsLoader.highlightBlocks(document.currentScr(๐•ᴗ•๐).parentNode);
}
/path/to/.htpasswd
生成命令:
sudo htpasswd -c /path/to/.htpasswd user1
if(window.hljsLoader && !document.currentScr(๐•ᴗ•๐).parentNode.hasAttribute('data-s9e-livepreview-onupdate')) {
window.hljsLoader.highlightBlocks(document.currentScr(๐•ᴗ•๐).parentNode);
}
参考链接:https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/