-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## 注意点: | ||
``` | ||
一、如果不知道文件大小时,需设置 | ||
client_max_body_size 0; | ||
二、如果要开启tus,并使用nginx反向代理,需要设置proxy_redirect | ||
并且重定向 | ||
proxy_redirect ~/(\w+)/big/upload/(.*) /$1/big/upload/$2; #继点续传一定要设置(注意) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
worker_processes 1; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include mime.types; | ||
default_type application/html; | ||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
access_log /var/log/nginx/access.log main; | ||
error_log /var/log/nginx/error.log error; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
#rewrite_log on; | ||
client_max_body_size 0; | ||
proxy_redirect ~/(\w+)/big/upload/(.*) /$1/big/upload/$2; #继点续传一定要设置(注意) | ||
upstream gofastdfs-group1 { | ||
server 10.1.51.70:8082; | ||
server 10.1.14.37:8080; | ||
ip_hash; #notice:very important(注意) | ||
} | ||
upstream gofastdfs-group2 { | ||
server 10.1.51.70:8083; | ||
server 10.1.14.36:8083; | ||
ip_hash; #notice:very important(注意) | ||
} | ||
server { | ||
listen 8000; | ||
server_name localhost; | ||
location /group1 { #以下header要设置 | ||
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_pass http://gofastdfs-group1; | ||
} | ||
location /group2 {#以下header要设置 | ||
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_pass http://gofastdfs-group2; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters