Reverse Proxy Setup
If you want to run Neko behind a reverse proxy, you can use the following examples to configure your server.
:::tip Do not forget to enable server.proxy=true
in your config.yml
file to allow the server to trust the proxy headers. :::
Neko pings websocket client every 10 seconds, and client is scheduled to send heartbeat to the server every 120 seconds. Make sure, that your timeout settings in the reverse proxy are set accordingly.
Traefik v2 {#traefik-v2}
See the example below for a docker-compose.yml
file.
For more information, check out the official Traefik documentation. For SSL, see the official Traefik SSL documentation.
Nginx {#nginx}
See the example below for an Nginx configuration file.
For more information, check out the official Nginx documentation. For SSL, see the official Nginx SSL documentation or use certbot.
Apache {#apache}
To do this, you need to have a running Apache server. Navigate to the /etc/apache2/sites-available
folder and create a new configuration file, for example, neko.conf
.
After creating the new configuration file, you can use the example below and paste it in. Some things may vary on your machine, so read through and modify it if needed.
Bear in mind that your Neko server does not have to run on the same computer as Apache. They just need to be on the same network, and then you replace localhost
with the correct internal IP.
After creating your new configuration file, just use sudo a2ensite neko.conf
and then sudo systemctl reload apache2
.
See the official Apache documentation for more information. For SSL, see the official Apache SSL documentation or use certbot.
Caddy {#caddy}
See the example below for a Caddyfile.
For more information, check out the official Caddy documentation. For SSL, see the official Caddy automatic HTTPS documentation.
HAProxy {#haproxy}
Using your frontend section (mine is called http-in), add the ACL to redirect correctly to your Neko instance.
Then, restart the HAProxy service.
See the official HAProxy documentation for more information.
If you're having trouble reaching your HAProxy instance, try the following steps:
Check HAProxy Logs Verify what HAProxy is reporting by checking its status:
Monitor Logs in Real-Time If the service is running and the ACL rule and backend configuration seem correct, tail the logs to investigate further:
Then, access your
neko.instance.com
and observe the logs for any issues.Adjust Timeout Settings Ensure the global timeout is set to 60 seconds to prevent premature request failures:
Configure Defaults Section Add the following settings to the
defaults
section to handle timeouts and forward headers properly:
:::note Don't forget to restart the service each time you modify the .cfg
file! :::