> For the complete documentation index, see [llms.txt](https://vitrina-blogerov.gitbook.io/bloggers-showcase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vitrina-blogerov.gitbook.io/bloggers-showcase/product-docs/product-docs-en/architecture/error-pages.md).

# Error pages

Error pages are shown when the user lands on a protected route, a non-existent page, or when the backend is temporarily unavailable.

<figure><img src="https://162603775-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuwCSpQuu1p5soxSClCET%2Fuploads%2FkDceke8AygX0uOQLJQ0s%2Fimage.png?alt=media&amp;token=2a92e922-86a9-4a7b-b7db-7912eb032366" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The platform has two levels of errors: edge errors from Caddy and backend errors from FastAPI. These are different situations.
{% endhint %}

### Which errors are used

| Code  | When it appears                                  |
| ----- | ------------------------------------------------ |
| `403` | Access denied.                                   |
| `404` | Page or path not found.                          |
| `502` | Caddy could not get a response from the backend. |

### Where the pages are located

{% tabs %}
{% tab title="Edge Caddy" %}

```
/opt/bloggers_platform/edge/www/errors/403.html
/opt/bloggers_platform/edge/www/errors/404.html
/opt/bloggers_platform/edge/www/errors/502.html
```

These pages are shown by Caddy.
{% endtab %}

{% tab title="Backend" %}

```
templates/403.html
templates/404.html
templates/502.html
```

These pages are located inside the language version and can be used by the backend layer.
{% endtab %}
{% endtabs %}

### How the page is chosen

```mermaid
flowchart TB
    A["User request"] --> B{"Did Caddy find the route?"}
    B -->|no| C["Edge 404"]
    B -->|yes| D{"Does the backend respond?"}
    D -->|no| E["Edge 502"]
    D -->|yes| F["FastAPI"]
    F --> G{"Is access available?"}
    G -->|no| H["403"]
    G -->|yes| I["Page or API response"]
```

### Important

<details>

<summary>If a white screen appears on a non-existent path</summary>

Most often this means the error page loaded, but failed to pull in styles or the background. You need to check the absolute paths to `/assets/style.css` and `/assets/bg.mp4`.

</details>

<details>

<summary>If the standard Caddy error is visible</summary>

It means Caddy could not find or could not serve the branded page from `/errors`. Check the folder `/opt/bloggers_platform/edge/www/errors`.

</details>

<details>

<summary>If 502 appears</summary>

Check the backend container for the required language version and the shared edge:

```bash
sudo /opt/bloggers_platform/apps/ru/manager.sh status
sudo /opt/bloggers_platform/manager.sh status
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://vitrina-blogerov.gitbook.io/bloggers-showcase/product-docs/product-docs-en/architecture/error-pages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
