update: optimize environment
This commit is contained in:
@@ -3,10 +3,49 @@ map $http_upgrade $connection_upgrade {
|
||||
'' close;
|
||||
}
|
||||
|
||||
upstream rustfs_backend {
|
||||
server 8.153.151.51:9000;
|
||||
keepalive 64;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
# 全局或针对存储服务设置最大上传限制 (100G)
|
||||
client_max_body_size 100G;
|
||||
|
||||
# =========================================================================
|
||||
# 1. RustFS 对象存储服务转发 (/storage/)
|
||||
# =========================================================================
|
||||
location /storage/ {
|
||||
# 核心:透传 Host,确保 RustFS 生成的 Presigned URL 包含公网地址
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# 转发至 RustFS
|
||||
# 注意:如果 RustFS 内部接口也是 /storage/...,请把末尾的 / 去掉
|
||||
proxy_pass http://rustfs_backend/;
|
||||
|
||||
# HTTP/1.1 长连接支持
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
# 性能优化:关闭双向 Buffer,实现大文件流式传输
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
|
||||
# 大文件传输超时设置
|
||||
proxy_connect_timeout 300s;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
}
|
||||
|
||||
# =========================================================================
|
||||
# 2. Jupyter 服务配置
|
||||
# =========================================================================
|
||||
# 拒绝直接访问目录
|
||||
location ~ ^/jupyter/(?<workspace_id>[^/]+)/?$ {
|
||||
return 403 "Direct directory access is forbidden. Please specify a notebook path.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user