diff --git a/docs/guide/q3.md b/docs/guide/q3.md index 24a7e417..53e16e62 100644 --- a/docs/guide/q3.md +++ b/docs/guide/q3.md @@ -25,25 +25,38 @@ server { underscores_in_headers on; set_real_ip_from 0.0.0.0/0; # 替换为你的 CDN 回源 IP 地址段 real_ip_header CF-Connecting-IP; # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认 - + # grpc 相关 location ^~ /proto.NezhaService/ { grpc_set_header Host $host; - grpc_set_header nz-realip $http_CF_Connecting_IP; # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认 - grpc_read_timeout 300s; - grpc_send_timeout 300s; + grpc_set_header nz-realip $http_cf_connecting_ip; + grpc_read_timeout 600s; + grpc_send_timeout 600s; grpc_socket_keepalive on; + client_max_body_size 10m; + grpc_buffer_size 4m; grpc_pass grpc://dashboard; } - - location / { + # websocket 相关 + location ~* ^/api/v1/ws/(server|terminal|file)(.*)$ { proxy_set_header Host $host; + proxy_set_header nz-realip $http_cf_connecting_ip; # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认 proxy_set_header Origin https://$host; - proxy_set_header nz-realip $http_CF_Connecting_IP; # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认 - proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + proxy_pass http://dashboard; + } + # web + location / { + proxy_set_header Host $host; + proxy_set_header nz-realip $http_cf_connecting_ip; # 替换为你的 CDN 提供的私有 header,此处为 CloudFlare 默认 proxy_read_timeout 3600s; proxy_send_timeout 3600s; + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + proxy_max_temp_file_size 0; proxy_pass http://dashboard; } }