Spaces:
Running
Running
Delete nginx.conf
Browse files- nginx.conf +0 -54
nginx.conf
DELETED
|
@@ -1,54 +0,0 @@
|
|
| 1 |
-
# 项目根目录下的 nginx.conf
|
| 2 |
-
events {
|
| 3 |
-
worker_connections 1024;
|
| 4 |
-
}
|
| 5 |
-
|
| 6 |
-
http {
|
| 7 |
-
include mime.types;
|
| 8 |
-
default_type application/octet-stream;
|
| 9 |
-
|
| 10 |
-
# 开启 Range 支持
|
| 11 |
-
range_resolver on;
|
| 12 |
-
range_buffer_size 16k;
|
| 13 |
-
|
| 14 |
-
# 静态文件服务配置
|
| 15 |
-
server {
|
| 16 |
-
listen 80;
|
| 17 |
-
server_name localhost;
|
| 18 |
-
|
| 19 |
-
# 配置静态文件目录
|
| 20 |
-
location /static/ {
|
| 21 |
-
root /path/to/your/project;
|
| 22 |
-
# 开启断点续传支持
|
| 23 |
-
add_header Accept-Ranges bytes;
|
| 24 |
-
# 启用缓存
|
| 25 |
-
expires 30d;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
# 配置 API 代理
|
| 29 |
-
location /api/ {
|
| 30 |
-
proxy_pass http://localhost:5000; # 假设后端运行在5000端口
|
| 31 |
-
proxy_http_version 1.1;
|
| 32 |
-
proxy_set_header Upgrade $http_upgrade;
|
| 33 |
-
proxy_set_header Connection 'upgrade';
|
| 34 |
-
proxy_set_header Host $host;
|
| 35 |
-
proxy_cache_bypass $http_upgrade;
|
| 36 |
-
|
| 37 |
-
# 开启 Range 支持
|
| 38 |
-
proxy_set_header Range $http_range;
|
| 39 |
-
proxy_set_header If-Range $http_if_range;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
# 配置文件下载
|
| 43 |
-
location /download/ {
|
| 44 |
-
root /path/to/your/project;
|
| 45 |
-
# 开启断点续传
|
| 46 |
-
add_header Accept-Ranges bytes;
|
| 47 |
-
# 设置缓存
|
| 48 |
-
expires 7d;
|
| 49 |
-
# 启用 gzip 压缩
|
| 50 |
-
gzip on;
|
| 51 |
-
gzip_types application/octet-stream;
|
| 52 |
-
}
|
| 53 |
-
}
|
| 54 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|