intro.adoc 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. [#reverse-proxies]
  2. = Reverse Proxies
  3. This section of the documentation has a few examples of reverse proxy configurations for popular reverse proxy servers.
  4. Configuring a reverse proxy server for OliveTin is entirely optional. If you don't want to use a reverse proxy, you can skip this section.
  5. [#proxy-guide]
  6. == Reverse Proxy general guide
  7. It's common to put OliveTin behind a reverse proxy, for authentication, customizing the OliveTin address/path, or for a variety of other reasons.
  8. === DNS name vs Path based proxies
  9. DNS Name based virtual hosts (eg: olivetin.example.com ) are easier to setup and configure than path based virtual hosts (eg: www.example.com/utils/OliveTin), because path based virtual hosts need to take care mangle OliveTin paths without breaking things.
  10. * If using a path based reverse proxies, you may need to set `externalRestAddress` manually to something like; `http://example.com/utils/OliveTin` in the OliveTin config.yaml.
  11. * If using DNS Name based reverse proxies, then you should not need to change anything in config.yaml
  12. ==== Which port?
  13. If you look at OliveTin startup logs, you will see OliveTin starting services on several ports. For most users, even under reverse proxy configurations, just proxying port 1337 should be all that is needed. To better understand why OliveTin uses several internal ports by default, see xref:reference/network-ports.adoc[network-ports].
  14. === Handling websockets
  15. OliveTin versions after 2023-08 use websockets instead of polling for updates. Ensure your proxy re-passes the `Connection: Upgrade` and `Upgrade: websocket` headers for the websocket path. In OliveTin 3k the websocket endpoint is `api/olivetin.api.v1.OliveTinApiService/EventStream`; when proxying the whole site (e.g. `ProxyPass /` or `location /`), that path is covered automatically.
  16. Many reverse proxies use short default timeouts and will close long-lived websocket connections, causing disconnects (OliveTin will reconnect automatically). To avoid this, increase the websocket or proxy timeout in your reverse proxy—see the individual proxy pages (e.g. xref:reverse-proxies/apache.adoc[Apache]) and xref:troubleshooting/err-websocket-connection.adoc[Error Connecting to WebSocket] for details.
  17. ==== General checklist
  18. * `olivetin.example.com/*` is all just HTTP traffic (port 1337)
  19. ** `olivetin.example.com/` should show the standard webui (port 1337)
  20. ** `olivetin.example.com/webUiSettings.json` should return a JSON file generated by OliveTin that sets up the web interface. (port 1337)
  21. ** `olivetin.example.com/api` should show the REST based API. (port 1337)
  22. * The websocket (e.g. `api/olivetin.api.v1.OliveTinApiService/EventStream` in OliveTin 3k) should be a websocket connection upgrade.
  23. == What's Next?
  24. Choose your reverse proxy and follow the configuration guide:
  25. * xref:reverse-proxies/nginx.adoc[Nginx] - Configure Nginx as a reverse proxy
  26. * xref:reverse-proxies/apache.adoc[Apache] - Configure Apache as a reverse proxy
  27. * xref:reverse-proxies/caddy.adoc[Caddy] - Configure Caddy as a reverse proxy
  28. * xref:reverse-proxies/traefik.adoc[Traefik] - Configure Traefik as a reverse proxy
  29. * xref:reverse-proxies/haproxy.adoc[HAProxy] - Configure HAProxy as a reverse proxy
  30. * xref:reverse-proxies/nginx_proxy_manager.adoc[Nginx Proxy Manager] - Configure NPM as a reverse proxy
  31. * xref:security/trusted_header.adoc[Use trusted headers] - Authenticate users via reverse proxy headers
  32. * xref:reference/network-ports.adoc[Understand network ports] - Learn about OliveTin's port configuration