📂 solution-1.0

← 返回上级
# org.rosicky.top → 分资产(Task-Org)管理
# HTTP → HTTPS 跳转
server {
    listen 80;
    server_name org.rosicky.top;
    return 301 https://$host$request_uri;
}

# HTTPS
server {
    listen 443 ssl;
    server_name org.rosicky.top;
    charset utf-8;
    access_log /var/log/nginx/hermes-access.log;
    error_log /var/log/nginx/hermes-error.log;

    ssl_certificate /root/.acme.sh/org.rosicky.top_ecc/fullchain.cer;
    ssl_certificate_key /root/.acme.sh/org.rosicky.top_ecc/org.rosicky.top.key;

    # API — 去掉 /api/ 前缀
    location /api/ {
        rewrite ^/api/(.*) /$1 break;
        proxy_pass http://127.0.0.1:8766;
        proxy_http_version 1.1;
        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_read_timeout 30s;
    }

    # TaskSelector JS 组件
    location = /task-selector.js {
        root /var/www;
        add_header Cache-Control "no-cache";
    }

    # 根路径
    location / {
        root /var/www/task-org;
        index index.html;
        try_files $uri $uri/ /index.html;
        add_header Cache-Control "no-cache, no-store, must-revalidate";
    }
}