Skip to content

Commit 58f4e8f

Browse files
committed
Add Dedicated DNS Mode
1 parent 96aaa7b commit 58f4e8f

File tree

2 files changed

+153
-1
lines changed

2 files changed

+153
-1
lines changed

docs/en/integration/nginx.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,88 @@ server {
121121

122122
If you need to add multiple RustFS servers in a distributed environment, please adjust DNS resolution or local Hosts addresses in advance, and modify and add servers.
123123

124-
```nginx
124+
```
125125
upstream rustfs {
126126
least_conn;
127127
server 10.0.0.1:9000;
128128
server 10.0.0.2:9000;
129129
server 10.0.0.3:9000;
130130
server 10.0.0.4:9000;
131131
}
132+
133+
134+
upstream rustfs-console {
135+
least_conn;
136+
server 10.0.0.1:9001;
137+
server 10.0.0.2:9001;
138+
server 10.0.0.3:9001;
139+
server 10.0.0.4:9001;
140+
}
132141
```
142+
143+
144+
## 4. Dedicated DNS Mode
145+
Create or configure a dedicated DNS name for the RustFS service.
146+
147+
Proxy requests for the RustFS server's S3 API to the /api/ path of this domain. Proxy requests for the RustFS Console Web GUI to the root path (/).
148+
For example, given the hostname www.rustfs.dev:
149+
Endpoint: `www.rustfs.dev/api/`
150+
Console: `www.rustfs.dev`
151+
152+
153+
~~~
154+
server {
155+
listen 443;
156+
listen [::]:443;
157+
http2 on;
158+
server_name www.rustfs.dev;
159+
160+
# Allow special characters in headers
161+
ignore_invalid_headers off;
162+
# Allow any size file to be uploaded.
163+
# Set to a value such as 1000m; to restrict file size to a specific value
164+
client_max_body_size 0;
165+
# Disable buffering
166+
proxy_buffering off;
167+
proxy_request_buffering off;
168+
169+
# S3 API
170+
171+
location /api {
172+
proxy_set_header Host $http_host;
173+
proxy_set_header X-Real-IP $remote_addr;
174+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
175+
proxy_set_header X-Forwarded-Proto $scheme;
176+
177+
proxy_connect_timeout 300;
178+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
179+
proxy_http_version 1.1;
180+
proxy_set_header Connection "";
181+
chunked_transfer_encoding off;
182+
183+
proxy_set_header Upgrade $http_upgrade;
184+
proxy_set_header Connection "upgrade";
185+
186+
proxy_pass http://127.0.0.1:9000;
187+
}
188+
189+
# Console
190+
191+
location / {
192+
proxy_set_header Host $http_host;
193+
proxy_set_header X-Real-IP $remote_addr;
194+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
195+
proxy_set_header X-Forwarded-Proto $scheme;
196+
197+
proxy_connect_timeout 300;
198+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
199+
proxy_http_version 1.1;
200+
proxy_set_header Connection "";
201+
chunked_transfer_encoding off;
202+
203+
proxy_set_header Upgrade $http_upgrade;
204+
proxy_set_header Connection "upgrade";
205+
proxy_pass http://127.0.0.1:9001;
206+
}
207+
}
208+
~~~

docs/zh/integration/nginx.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,83 @@ upstream rustfs {
136136
server 10.0.0.3:9000;
137137
server 10.0.0.4:9000;
138138
}
139+
140+
141+
upstream rustfs-console {
142+
least_conn;
143+
server 10.0.0.1:9001;
144+
server 10.0.0.2:9001;
145+
server 10.0.0.3:9001;
146+
server 10.0.0.4:9001;
147+
}
148+
~~~
149+
150+
151+
## 四、 专用DNS模式
152+
153+
为 RustFS 服务创建或配置一个专用的 DNS 名称。
154+
155+
对于 RustFS 服务器 S3 API,将请求代理到该域名的/api/ 目录。 对于 RustFS 控制台的 Web GUI,将请求代理到 / 根路径。
156+
157+
例如, 给定主机名 www.rustfs.dev :
158+
159+
- Endpoint的地址为 www.rustfs.dev/api/
160+
- Console的地址为
161+
162+
139163
~~~
164+
server {
165+
listen 443;
166+
listen [::]:443;
167+
http2 on;
168+
server_name www.rustfs.dev;
169+
170+
# Allow special characters in headers
171+
ignore_invalid_headers off;
172+
# Allow any size file to be uploaded.
173+
# Set to a value such as 1000m; to restrict file size to a specific value
174+
client_max_body_size 0;
175+
# Disable buffering
176+
proxy_buffering off;
177+
proxy_request_buffering off;
178+
179+
# S3 API
180+
181+
location /api {
182+
proxy_set_header Host $http_host;
183+
proxy_set_header X-Real-IP $remote_addr;
184+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
185+
proxy_set_header X-Forwarded-Proto $scheme;
186+
187+
proxy_connect_timeout 300;
188+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
189+
proxy_http_version 1.1;
190+
proxy_set_header Connection "";
191+
chunked_transfer_encoding off;
192+
193+
proxy_set_header Upgrade $http_upgrade;
194+
proxy_set_header Connection "upgrade";
195+
196+
proxy_pass http://127.0.0.1:9000;
197+
}
198+
199+
# Console
140200
201+
location / {
202+
proxy_set_header Host $http_host;
203+
proxy_set_header X-Real-IP $remote_addr;
204+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
205+
proxy_set_header X-Forwarded-Proto $scheme;
141206
207+
proxy_connect_timeout 300;
208+
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
209+
proxy_http_version 1.1;
210+
proxy_set_header Connection "";
211+
chunked_transfer_encoding off;
142212
213+
proxy_set_header Upgrade $http_upgrade;
214+
proxy_set_header Connection "upgrade";
215+
proxy_pass http://127.0.0.1:9001;
216+
}
217+
}
218+
~~~

0 commit comments

Comments
 (0)