Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Using Flood behind a reverse proxy

nitnelave edited this page Jul 29, 2020 · 12 revisions

In order to use Flood behind a reverse proxy, you must be sure to forward all requests to Flood's node server.

Served from a nested route

Often people want to expose multiple web applications with a single nginx config. This is possible using Flood's baseURI option and nginx's proxy_pass.

In the following configuration example, let's assume Flood is running at 127.0.0.1:3000, and that you would like to serve Flood from nested route /flood (e.g. https://some-domain.com/flood).

Your nginx config should contain these rules:

location /flood/ {
  proxy_pass http://127.0.0.1:3000/;
}

Your Flood config should contain the following value:

baseURI: '/flood'

Note: You must recompile static assets after changing the baseURI configuration option.

Served from the root

Now, let's assume Flood is running at 127.0.0.1:3000, and that you would like to serve Flood from the root (e.g. https://some-domain.com).

Your nginx config should contain these rules:

location / {
  proxy_pass http://127.0.0.1:3000;
}

And your Flood config should contain the following values:

baseURI: '/'

Disable buffering

In both cases, in order to pass on the events from the event-stream, the request should not be buffered. You can disable buffering in nginx by adding these lines in your location block:

proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;

Note that these are only strictly required for the event stream, so if it poses problems you can set it only for the /api/ location.

ArchLinux - Install rTorrent, Flood and SFTP

https://rawsec.ml/en/archlinux-install-rtorrent-flood-sftp/