Update Nginx config to use double siad setup (#97)

* Update nginx conf to use double siad setup
* Update documentation
This commit is contained in:
Peter-Jan Brone 2020-03-19 15:38:34 +01:00 committed by GitHub
parent 1457816e5e
commit cd619d7a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -57,13 +57,18 @@ To enable the service: `systemctl --user enable siad.service`
### Running 2 siad instances
In some cases, portal operators may want to run 2 `siad` nodes on the same
server. One node to prioritize downloads and one to prioritze uploads The
scripts here also do the initial setup for a 2nd `siad` instance running as a
It is recommended to run 2 `siad` nodes on the same server. One node to
prioritize downloads and one to prioritze uploads. This will drastically improve
performance of both up - and download. The setup scripts assume this double siad
setup and perform the initial setup for a 2nd `siad` instance running as a
systemd service `siad-upload.service` in the `~/siad-upload/` directory with
environment variables in `sia-upload.env`. You must fill out the correct values
for those environment variables.
Note that running 2 `siad` nodes is not obligatory. You can run a portal with
just one `siad` node just fine. If you choose to do so, simply ignore the second
`siad` node and point everything to your single node instead.
The `bashrc` file in this repository also provides an alias `siac-upload` that
loads the correct environment variables and sets the correct ports to interact
with the 2nd `siad` node.

View File

@ -46,8 +46,18 @@ server {
location /skynet/skyfile/ {
client_max_body_size 1000M; # make sure to limit the size of upload to a sane value
proxy_read_timeout 600;
# proxy this call to siad endpoint (make sure the ip is correct)
proxy_pass http://127.0.0.1:9980;
#
# note that we point uploads to port '9970', do this when you want to
# run in a configuration where you have two siad instances, one for
# downloads and one for uploads. This drastically improves the up - and
# download speed of your portal. When running your portal in this double
# siad setup, make sure only the download portal runs in 'portal mode'.
# The upload siad can be run in normal mode. Set the port to '9980' if
# you do not want to run your portal in the double siad setup.
proxy_pass http://127.0.0.1:9970;
proxy_set_header Expect $http_expect;
add_header Access-Control-Allow-Origin *;
proxy_hide_header Access-Control-Allow-Origin;