About

This is a standard subfolder configuration for reverse-proxying Resilio Sync, listening on the same machine on port 8888, by accessing the machine as the URL plus the /sync/ subpath.

In order for this template to work, caddy must be compiled with the replace-response module because it rewrites the response document in order to prepend the /sync/ subpath.

Configuration

        redir /sync /sync/
        handle_path /sync/* {
                rewrite * /gui{uri}
                reverse_proxy 127.0.0.1:8888 {
                        header_up Host 127.0.0.1:8888
                        header_up X-Forwarded-Host {hostport}
                        header_up Accept-Encoding identity
                }
                replace {
                        "/gui/token.html" "/sync/token.html"
                        "/gui" "/sync"
                }

        }