Load balancers

This section describes relevant settings and requirements when Arkindex is installed behind a load balancer.

Backend port

By default, the Arkindex backend listens for HTTP requests on port 8000. You can change this port by setting the PORT environment variable.

HTTP header forwarding

Parts of the Arkindex backend may generate absolute URLs to resources. To do so, they will need access to the protocol and hostname used in the original request, not those used by the load balancer when forwarding the request. Load balancers must be configured to provide the X-Forwarded-Proto and X-Forwarded-Host HTTP headers.

To test whether those headers are properly passed through and the Arkindex backend generates correct URLs, you may request a password reset, or register a new user. This will send an email containing a link computed from the HTTP headers sent during the reset or registration request.

Backend URLs

By default, the Arkindex backend will only respond to a specific subset of URLs. Other URLs will result in HTTP 404 errors. When the static.cdn_assets_url setting is set, the backend will respond to unknown URLs by serving the Arkindex frontend instead.

With more complex configurations where the load balancer may be in charge of serving the Arkindex frontend, the following URL prefixes should be configured to be passed through to the backend:

/api/

The Arkindex API.

/api-docs/

The Arkindex API documentation.

/admin/

The administration interface.

/oidc/

Endpoints used for OpenID Connect authentication.

/rq/

The asynchronous tasks management interface.