Skip to content
Darren edited this page Feb 4, 2016 · 1 revision

Reverse Proxies

With any reverse proxy setup you would probably want to change the path someone uses to access Kiwi. The default path is /kiwi/ but this may be changed in the config file under conf.http_base_path.

You may switch /kiwi anywhere in this document for the path you specify in your config.

Make sure to whitelist any proxy servers! This is done by adding the address of your proxy connections to conf.http_proxies in your config.js. Any unlisted connections attempting to specify the clients real-ip will be forcefully rejected.

Most, if not all reverse proxies will be far slower than connecting directly to a kiwi server. This is in part due to websockets not being supported by many proxies as of yet. Clients will be forced to poll the kiwi server for new data instead of being sent new data directly.

Apache mod_proxy

Assuming you have mod_proxy setup and working, people have got it working with the following as a guideline:

ProxyVia On
ProxyRequests Off
ProxyPass /kiwi/ http://localhost:7778/kiwi/
ProxyPassReverse /kiwi/ http://localhost:7778/kiwi/
ProxyPreserveHost on

Cloudflare

Make sure caching is disabled for your Kiwi URL. The addresses to use in conf.http_proxies can be found at https://www.cloudflare.com/ips

Nginx

Nginx should support reverse proxying out of the box. An example of a working config:

location /kiwi/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;

        proxy_pass http://localhost:7778/kiwi/;
        proxy_redirect default;

        # Websocket support (from version 1.4)
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
}