访问
- 打开浏览器并访问:
https://<SERVER_IP> - A browser SSL warning is expected (self-signed certificate)
- Authentication is required (Basic Auth popup)
- Authentication method: HTTP Basic Auth
- Credentials are stored securely in:
/root/.cloudzy-creds
重要文件和目录
- 安装目录:
/opt/glance - Docker Compose:
/opt/glance/docker-compose.yml - 环境文件:
/opt/glance/.env - Config directory:
/opt/glance/config - Home config:
/opt/glance/config/home.yml - Main config:
/opt/glance/config/glance.yml - Assets directory:
/opt/glance/assets - Custom CSS:
/opt/glance/assets/user.css - Nginx config:
/etc/nginx/sites-available/glance.conf - SSL证书:
/etc/nginx/ssl - Auth file:
/etc/nginx/auth/.glance-htpasswd - 凭证文件:
/root/.glance-credentials
Manage the Stack
Go to the installation directory:
cd /opt/glance
Common Docker Compose commands:
# Check status
docker compose ps
# View logs (follow live)
docker compose logs -f
# Restart all services
docker compose restart
# Stop services
docker compose down
# Start again
docker compose up -d
Disable HTTP Basic Auth in Nginx (Optional)
Edit the Nginx site file: /etc/nginx/sites-available/glance.conf
Remove or comment out these lines:
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/auth/.glance-htpasswd;
重新加载 Nginx:
systemctl restart nginx
为域名启用SSL
1. 将您的域名指向服务器IP地址。
2. 编辑 Nginx 配置文件并替换两处 server_name <IP>; 使用您的域名 (<your-domain>) 同时适用于 HTTP(端口 80)和 HTTPS(端口 443)的封堵:
vim /etc/nginx/sites-available/glance.conf
3. 安装 Certbot:
apt install -y certbot python3-certbot-nginx
4. 运行以下命令以生成有效的 Let’s Encrypt 证书:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. 在 Nginx 配置中替换 SSL 路径:
vim /etc/nginx/sites-available/glance.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. 重启 Nginx 以应用更改:
systemctl restart nginx
7. 打开浏览器并访问: https://yourdomain.com