cmp20.bitheart.org {
    # API代理
    handle /api/* {
        reverse_proxy http://172.17.0.1:12011 {
            header_up Host {host}
            header_up X-Forwarded-For {remote}
            header_up X-Forwarded-Proto {scheme}
            header_up X-Forwarded-Port {server_port}
        }
    }
    
    # blockBrowser和static/upload路径代理
    @blockbrowser_or_upload {
        path_regexp ^(/blockBrowser|/static/upload)
    }
    handle @blockbrowser_or_upload {
        reverse_proxy http://172.17.0.1:12011 {
            header_up Host {host}
            header_up X-Forwarded-For {remote}
            header_up X-Forwarded-Proto {scheme}
            header_up X-Forwarded-Port {server_port}
        }
    }
    
    # blockBrowser特定配置
    handle /blockBrowser* {
        reverse_proxy http://172.17.0.1:12011 {
            header_up Host {host}
            header_up X-Forwarded-For {remote}
            header_up X-Forwarded-Proto {scheme}
            header_up X-Forwarded-Port {server_port}
            header_down Strict-Transport-Security "max-age=31536000; includeSubdomains"
            header_down X-Content-Type-Options nosniff
            header_down X-Frame-Options SAMEORIGIN
            header_down Referrer-Policy origin
            header_down Content-Security-Policy upgrade-insecure-requests
        }
    }
    
    # IPFS代理
    handle /ipfs/* {
        reverse_proxy http://172.17.0.1:18080 {
            header_up Host {host}
            header_up X-Forwarded-For {remote}
            header_up X-Forwarded-Proto {scheme}
            header_up X-Forwarded-Port {server_port}
        }
    }
    
    # 静态文件服务
    handle {
        header Strict-Transport-Security "max-age=31536000; includeSubdomains"
        header X-Content-Type-Options nosniff
        header X-Frame-Options SAMEORIGIN
        header X-Content-Type-Options nosniff
        header Referrer-Policy origin
        header Content-Security-Policy upgrade-insecure-requests
        
        root * /web
        try_files {path} {path}/ /index.html
        file_server 
    }
}

