Merge pull request 'Improve Nginx reverse proxy example' (#413) from baptiste/garage:nginx_fix into main

Reviewed-on: Deuxfleurs/garage#413
This commit is contained in:
Alex 2022-11-14 12:21:56 +00:00
commit 39ac295eb7

View file

@ -70,14 +70,16 @@ A possible configuration:
```nginx ```nginx
upstream s3_backend { upstream s3_backend {
# if you have a garage instance locally # If you have a garage instance locally.
server 127.0.0.1:3900; server 127.0.0.1:3900;
# you can also put your other instances # You can also put your other instances.
server 192.168.1.3:3900; server 192.168.1.3:3900;
# domain names also work # Domain names also work.
server garage1.example.com:3900; server garage1.example.com:3900;
# you can assign weights if you have some servers # A "backup" server is only used if all others have failed.
# that are more powerful than others server garage-remote.example.com:3900 backup;
# You can assign weights if you have some servers
# that can serve more requests than others.
server garage2.example.com:3900 weight=2; server garage2.example.com:3900 weight=2;
} }
@ -96,6 +98,8 @@ server {
proxy_pass http://s3_backend; proxy_pass http://s3_backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host; proxy_set_header Host $host;
# Disable buffering to a temporary file.
proxy_max_temp_file_size 0;
} }
} }
``` ```