location /public {
    root /data;
}

# WebSocket 支持
location /ws/ {
    proxy_pass http://websocket;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP __IP_HEADER__;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    
    # WebSocket 超时设置
    proxy_connect_timeout 7d;
    proxy_send_timeout 7d;
    proxy_read_timeout 7d;
}

location /api {
    include api_proxy.conf;
}

# location /admin {
#     root /app/dist/admin;
#     try_files $uri $uri/ /index.html =404;
# }

location /.well-known {
    alias /data/ssl/.well-known;
}

location / {
    root /app/dist;
    try_files $uri $uri/ /index.html =404;
}
