# Health check

## Core & Proxy

### Rest API

[Core](https://github.com/defguard/defguard) and [Proxy](https://github.com/defguard/proxy) provides health endpoint at  `GET /api/v1/health` which checks whether the application server is running.

Example request:

```bash
curl "https://defguard.example.com/api/v1/health" 
```

Example response:

```
alive
```

### gRPC status health

#### Proxy (available from v0.6.0)

To verify gRPC services for **Proxy** are alive, there is endpoint at `GET /api/v1/health-grpc` that verify it.

Example request:

```bash
curl "https://enroll.example.com/api/v1/health-grpc"
```

Possible responses:

```
200 - Proxy is working and is connected to CORE
503 - Proxy works but is not connected to CORE
```

#### Core (available from v1.0.0)

To check if core gRCP service is alive, we recommend to use community tools like [grpc\_health\_probe](https://github.com/grpc-ecosystem/grpc-health-probe).

Example request for core:

```sh
./grpc_health_probe -addr=defguard.example.com:50055
```

Example response for core:

```
status: SERVING
```

## Gateway

You can enable in gateway config ([example config](https://github.com/DefGuard/gateway/blob/main/example-config.toml)) a health check port, by adding the following line:

```
health_port = 55003
```

In this example, gateway will open an additional HTTP port number 55003 and will return the following HTTP status codes:

* <pre><code><strong>200 - Gateway is working and is connected to CORE
  </strong></code></pre>
* ```
  503 - gateway works but is not connected to CORE
  ```

By default no healthcheck ports are open.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defguard.net/1.4/deployment-strategies/health-check.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
