> ## Documentation Index
> Fetch the complete documentation index at: https://developers.aptranet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Origin behavior

> Configure origin protocol, redirects, timeouts, rewrites, forced responses, and failover.

Origin configuration controls how a distribution connects to its selected origin group and how it reacts before returning a response.

## Connection settings

* **Origin group:** the source set used by the distribution.
* **Protocol:** `http`, `https`, or `match`.
* **Connection timeout:** maximum time to establish the upstream connection.
* **Read timeout:** maximum wait while reading the upstream response.

On a configured failover condition, the edge can try a backup origin. Without an eligible backup, a timeout normally results in a `504` response.

## Origin redirects

Enable follow-origin-redirection and select the redirect status codes that the edge may follow. Prevent loops and avoid following a redirect to an untrusted hostname.

## Rewrites

Rewrites can use `break`, `last`, `redirect` (302), or `permanent` (301) behavior. Test path capture and query-string handling on the Aptranet hostname before applying a hostname-wide rule.

## Forced responses

A distribution can return a fixed status code and body or redirect target without contacting the origin. Use this for maintenance responses or controlled redirects, and disable it when the event ends.

<Tip>
  Observe origin latency and 5xx analytics before increasing timeouts. A longer timeout can conceal an overloaded origin while consuming edge connections.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.