umami
umami 服务器
docker方式
直接使用其 docker-compose.yml
---
version: '3'
services:
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami:umami@db:5432/umami
DATABASE_TYPE: postgresql
APP_SECRET: replace-me-with-a-random-string
depends_on:
db:
condition: service_healthy
restart: always
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- umami-db-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
umami-db-data:
直接启动即可
docker compose up -d
umami 配置
浏览器访问
浏览器访问 http:://ip:3000
可以配置 域名 https://domain
登录
默认 admin/umami
监控网站配置
Settings => Websites => Add Website
选择 Edit Halo umami 配置
进入console => 选择插件 => Umami => 设置
利用上面的信息填写
nginx 代理问题
server
{
server_name your-domain;
add_header Access-Control-Allow-Origin 'https://your-domain';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = 'OPTIONS') {
return 204;
}
add_header Content-Security-Policy 'frame-ancestors your-domain';
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://ip:port;
proxy_hide_header 'Access-Control-Allow-Origin';
proxy_hide_header 'Content-Security-Policy';
}
listen 443 http2 ssl;
ssl_certificate xxxx;
ssl_certificate_key xxx;
ssl_trusted_certificate xxx;
}