From d56c19b2aadf026c08e5d173dbc8b964c8611532 Mon Sep 17 00:00:00 2001 From: RisedSky Date: Fri, 16 Aug 2024 09:14:06 +0200 Subject: [PATCH] chore(docs): Add haproxy in the reverse-proxy section (#409) --- docs/getting-started/reverse-proxy.md | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/docs/getting-started/reverse-proxy.md b/docs/getting-started/reverse-proxy.md index 75da05b29..4fa7f4ab7 100644 --- a/docs/getting-started/reverse-proxy.md +++ b/docs/getting-started/reverse-proxy.md @@ -114,3 +114,60 @@ https://example.com { ``` (by @ccallahan, [source](https://github.com/nurdism/neko/pull/125/commits/eb4ceda75423b0d960c8aea0240acf6d7a10fef4)) + +## HAProxy + +Using your frontend section *(mine is called http-in)*, add the ACL to redirect correctly to your n.eko instance. + +```sh +frontend http-in + #/******** + #* NEKO * + acl neko_rule_http hdr(host) neko.domain.com # Adapt the domain + use_backend neko_srv if neko_rule_http + #********/ + + +backend neko_srv + mode http + option httpchk + server neko 172.16.0.0:8080 # Adapt the IP +``` + +Then, restart the haproxy service. +```sh +service haproxy restart +``` + +### Having trouble reaching your HAProxy ? + +Try theses solution : + +- Verify the logs / what HAProxy is telling you : +> ```sh +> service haproxy status +> ``` + +- If the service is UP and the ACL rule + backend is OK then tail the log and keep them to verify : +> ```sh +> tail -f /var/log/haproxy.log +> # after that, go to your neko.instance.com and look for the logs in the shell +> ``` + +- Ensure you set the timeout to 60 seconds before the request fail. +> ```sh +> global +> stats timeout 60s +> ``` + +- Ensure you set the forwardfor and the timeout aswell in the defaults section. +> ```sh +> defaults +> option forwardfor +> timeout connect 30000 +> timeout client 65000 +> timeout server 65000 +> ``` +*(Don't forget to restart the service each time you modify the `.cfg` file !)* + +(by @RisedSky)