nginx.adoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. [#nginx-dns]
  2. = Nginx
  3. include::partial$reverse-proxies/diagram.adoc[]
  4. This is an example of DNS based proxying with Nginx.
  5. ./etc/nginx/cond.d/OliveTin.conf
  6. [source,nginx]
  7. ----
  8. include::example$reverse-proxies/etc/reverse_proxy_nginx_dns.conf[]
  9. ----
  10. Increase the proxy timeout for the websocket location so the reverse proxy does not close long-lived connections; see xref:troubleshooting/err-websocket-connection.adoc#reverse-proxies-will-close-websockets[Reverse proxies will close websockets] if you see disconnects.
  11. [#nginx-path]
  12. == Custom paths
  13. These "custom path" instructions are for when you want to use OliveTin with a custom path like "apps.example.com/olivetin" instead of the root path + DNS name - eg: "olivetin.example.com". Generally it is **not recommended** to use a custom path for OliveTin. Instructions are provided below though, and it mostly-works.
  14. .nginx.conf
  15. [source,nginx]
  16. ----
  17. ....
  18. location /OliveTin/ {
  19. proxy_pass http://localhost:1337/;
  20. proxy_redirect http://localhost:1337/ http://localhost/OliveTin/;
  21. }
  22. location /OliveTin/websocket {
  23. proxy_set_header Upgrade "websocket";
  24. proxy_set_header Connection "upgrade";
  25. proxy_pass http://localhost:1337/websocket;
  26. proxy_read_timeout 600s;
  27. proxy_send_timeout 600s;
  28. }
  29. ....
  30. ----
  31. include::partial$reverse-proxies/external-rest.adoc[]