Skip to content

Commit 96aaa7b

Browse files
committed
fixed nginx configure
1 parent 1b09a41 commit 96aaa7b

5 files changed

Lines changed: 315 additions & 24 deletions

File tree

docs/en/integration/nginx.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,17 @@ upstream rustfs {
2828
least_conn;
2929
server 127.0.0.1:9000;
3030
}
31+
32+
upstream rustfs-console {
33+
least_conn;
34+
server 127.0.0.1:9001;
35+
}
36+
37+
3138
server {
32-
listen 8000;
33-
listen [::]:8000;
34-
server_name _;
39+
listen 80;
40+
listen [::]:80;
41+
server_name YOUR_DOMAIN;
3542
3643
# Allow special characters in headers
3744
ignore_invalid_headers off;
@@ -48,6 +55,9 @@ server {
4855
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
4956
proxy_set_header X-Forwarded-Proto $scheme;
5057
58+
# Disable Nginx from converting HEAD to GET
59+
# proxy_cache_convert_head off;
60+
5161
proxy_connect_timeout 300;
5262
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
5363
proxy_http_version 1.1;
@@ -57,9 +67,54 @@ server {
5767
proxy_set_header Upgrade $http_upgrade;
5868
proxy_set_header Connection "upgrade";
5969
70+
71+
72+
6073
proxy_pass http://rustfs; # This uses the upstream directive definition to load balance
6174
}
6275
}
76+
77+
78+
server {
79+
listen 8080;
80+
listen [::]:8080;
81+
server_name YOUR_DOMAIN;
82+
83+
# Allow special characters in headers
84+
ignore_invalid_headers off;
85+
# Allow any size file to be uploaded.
86+
# Set to a value such as 1000m; to restrict file size to a specific value
87+
client_max_body_size 0;
88+
# Disable buffering
89+
proxy_buffering off;
90+
proxy_request_buffering off;
91+
92+
location / {
93+
proxy_set_header Host $http_host;
94+
proxy_set_header X-Real-IP $remote_addr;
95+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
96+
proxy_set_header X-Forwarded-Proto $scheme;
97+
98+
# Disable Nginx from converting HEAD to GET
99+
# proxy_cache_convert_head off;
100+
101+
proxy_connect_timeout 300;
102+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
103+
proxy_http_version 1.1;
104+
proxy_set_header Connection "";
105+
chunked_transfer_encoding off;
106+
107+
proxy_set_header Upgrade $http_upgrade;
108+
proxy_set_header Connection "upgrade";
109+
110+
111+
112+
113+
proxy_pass http://rustfs-console; # This uses the upstream directive definition to load balance
114+
}
115+
}
116+
117+
63118
```
64119

65120
## 3. Multi-Machine Load Balancing

docs/fr/integration/nginx.md

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,90 @@ upstream rustfs {
2929
least_conn;
3030
server 127.0.0.1:9000;
3131
}
32+
33+
upstream rustfs-console {
34+
least_conn;
35+
server 127.0.0.1:9001;
36+
}
37+
38+
3239
server {
33-
listen 8000;
34-
listen [::]:8000;
40+
listen 80;
41+
listen [::]:80;
42+
server_name YOUR_DOMAIN;
43+
44+
# Allow special characters in headers
45+
ignore_invalid_headers off;
46+
# Allow any size file to be uploaded.
47+
# Set to a value such as 1000m; to restrict file size to a specific value
48+
client_max_body_size 0;
49+
# Disable buffering
50+
proxy_buffering off;
51+
proxy_request_buffering off;
52+
53+
location / {
54+
proxy_set_header Host $http_host;
55+
proxy_set_header X-Real-IP $remote_addr;
56+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
57+
proxy_set_header X-Forwarded-Proto $scheme;
58+
59+
# Disable Nginx from converting HEAD to GET
60+
# proxy_cache_convert_head off;
61+
62+
proxy_connect_timeout 300;
63+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
64+
proxy_http_version 1.1;
65+
proxy_set_header Connection "";
66+
chunked_transfer_encoding off;
67+
68+
proxy_set_header Upgrade $http_upgrade;
69+
proxy_set_header Connection "upgrade";
70+
71+
72+
73+
74+
proxy_pass http://rustfs; # This uses the upstream directive definition to load balance
75+
}
76+
}
77+
78+
79+
server {
80+
listen 8080;
81+
listen [::]:8080;
82+
server_name YOUR_DOMAIN;
83+
84+
# Allow special characters in headers
85+
ignore_invalid_headers off;
86+
# Allow any size file to be uploaded.
87+
# Set to a value such as 1000m; to restrict file size to a specific value
88+
client_max_body_size 0;
89+
# Disable buffering
90+
proxy_buffering off;
91+
proxy_request_buffering off;
92+
93+
location / {
94+
proxy_set_header Host $http_host;
95+
proxy_set_header X-Real-IP $remote_addr;
96+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
97+
proxy_set_header X-Forwarded-Proto $scheme;
98+
99+
# Disable Nginx from converting HEAD to GET
100+
# proxy_cache_convert_head off;
101+
102+
proxy_connect_timeout 300;
103+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
104+
proxy_http_version 1.1;
105+
proxy_set_header Connection "";
106+
chunked_transfer_encoding off;
107+
108+
proxy_set_header Upgrade $http_upgrade;
109+
proxy_set_header Connection "upgrade";
110+
111+
112+
113+
114+
proxy_pass http://rustfs-console; # This uses the upstream directive definition to load balance
115+
}
116+
}
117+
118+
~~~

docs/ko/integration/nginx.md

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,21 @@ RustFS와 Nginx를 통합하면 다음과 같은 기능을 구현할 수 있습
3030

3131
~~~
3232
33-
3433
upstream rustfs {
3534
least_conn;
3635
server 127.0.0.1:9000;
3736
}
37+
38+
upstream rustfs-console {
39+
least_conn;
40+
server 127.0.0.1:9001;
41+
}
42+
43+
3844
server {
39-
listen 8000;
40-
listen [::]:8000;
41-
server_name _;
45+
listen 80;
46+
listen [::]:80;
47+
server_name YOUR_DOMAIN;
4248
4349
# Allow special characters in headers
4450
ignore_invalid_headers off;
@@ -55,6 +61,9 @@ server {
5561
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5662
proxy_set_header X-Forwarded-Proto $scheme;
5763
64+
# Disable Nginx from converting HEAD to GET
65+
# proxy_cache_convert_head off;
66+
5867
proxy_connect_timeout 300;
5968
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
6069
proxy_http_version 1.1;
@@ -71,6 +80,48 @@ server {
7180
}
7281
}
7382
83+
84+
server {
85+
listen 8080;
86+
listen [::]:8080;
87+
server_name YOUR_DOMAIN;
88+
89+
# Allow special characters in headers
90+
ignore_invalid_headers off;
91+
# Allow any size file to be uploaded.
92+
# Set to a value such as 1000m; to restrict file size to a specific value
93+
client_max_body_size 0;
94+
# Disable buffering
95+
proxy_buffering off;
96+
proxy_request_buffering off;
97+
98+
location / {
99+
proxy_set_header Host $http_host;
100+
proxy_set_header X-Real-IP $remote_addr;
101+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
102+
proxy_set_header X-Forwarded-Proto $scheme;
103+
104+
# Disable Nginx from converting HEAD to GET
105+
# proxy_cache_convert_head off;
106+
107+
proxy_connect_timeout 300;
108+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
109+
proxy_http_version 1.1;
110+
proxy_set_header Connection "";
111+
chunked_transfer_encoding off;
112+
113+
proxy_set_header Upgrade $http_upgrade;
114+
proxy_set_header Connection "upgrade";
115+
116+
117+
118+
119+
proxy_pass http://rustfs-console; # This uses the upstream directive definition to load balance
120+
}
121+
}
122+
123+
124+
74125
~~~
75126

76127

docs/tr/integration/nginx.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,28 @@ Entegrasyonun sorunsuz ilerlemesi için önceden hazırlamanız gerekenler:
2626

2727
~~~
2828
29-
3029
upstream rustfs {
3130
least_conn;
3231
server 127.0.0.1:9000;
3332
}
33+
34+
upstream rustfs-console {
35+
least_conn;
36+
server 127.0.0.1:9001;
37+
}
38+
39+
3440
server {
35-
listen 8000;
36-
listen [::]:8000;
37-
server_name _;
41+
listen 80;
42+
listen [::]:80;
43+
server_name YOUR_DOMAIN;
3844
39-
# Başlıklarda özel karakterlere izin ver
45+
# Allow special characters in headers
4046
ignore_invalid_headers off;
41-
# Herhangi bir boyutta dosyanın yüklenmesine izin ver.
42-
# Dosya boyutunu belirli bir değerle sınırlamak için 1000m gibi bir değere ayarlayın
47+
# Allow any size file to be uploaded.
48+
# Set to a value such as 1000m; to restrict file size to a specific value
4349
client_max_body_size 0;
44-
# Tamponlamayı devre dışı bırak
50+
# Disable buffering
4551
proxy_buffering off;
4652
proxy_request_buffering off;
4753
@@ -51,8 +57,11 @@ server {
5157
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5258
proxy_set_header X-Forwarded-Proto $scheme;
5359
60+
# Disable Nginx from converting HEAD to GET
61+
# proxy_cache_convert_head off;
62+
5463
proxy_connect_timeout 300;
55-
# Varsayılan HTTP/1'dir, keepalive sadece HTTP/1.1'de etkindir
64+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
5665
proxy_http_version 1.1;
5766
proxy_set_header Connection "";
5867
chunked_transfer_encoding off;
@@ -63,10 +72,53 @@ server {
6372
6473
6574
66-
proxy_pass http://rustfs; # Bu, yük dengeleme için upstream direktif tanımını kullanır
75+
proxy_pass http://rustfs; # This uses the upstream directive definition to load balance
6776
}
6877
}
6978
79+
80+
server {
81+
listen 8080;
82+
listen [::]:8080;
83+
server_name YOUR_DOMAIN;
84+
85+
# Allow special characters in headers
86+
ignore_invalid_headers off;
87+
# Allow any size file to be uploaded.
88+
# Set to a value such as 1000m; to restrict file size to a specific value
89+
client_max_body_size 0;
90+
# Disable buffering
91+
proxy_buffering off;
92+
proxy_request_buffering off;
93+
94+
location / {
95+
proxy_set_header Host $http_host;
96+
proxy_set_header X-Real-IP $remote_addr;
97+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
98+
proxy_set_header X-Forwarded-Proto $scheme;
99+
100+
# Disable Nginx from converting HEAD to GET
101+
# proxy_cache_convert_head off;
102+
103+
proxy_connect_timeout 300;
104+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
105+
proxy_http_version 1.1;
106+
proxy_set_header Connection "";
107+
chunked_transfer_encoding off;
108+
109+
proxy_set_header Upgrade $http_upgrade;
110+
proxy_set_header Connection "upgrade";
111+
112+
113+
114+
115+
proxy_pass http://rustfs-console; # This uses the upstream directive definition to load balance
116+
}
117+
}
118+
119+
120+
121+
70122
~~~
71123

72124
## Üç、Çok Makineli Yük Dengeleme

0 commit comments

Comments
 (0)