Overview
The SigNoz API server listens on port 8080 and serves the API and the SigNoz UI. By default, it serves plain HTTP. You can set it to serve HTTPS with your own certificate, without a reverse proxy (nginx, Traefik, or a cloud load balancer) that terminates TLS in front of SigNoz.
Prerequisites
- Self-Hosted SigNoz v0.142.0 or later.
- A certificate and its private key, both PEM-encoded. The certificate must match the hostname that users and API clients use to open SigNoz.
Enable TLS
Set these four environment variables on the SigNoz container:
SIGNOZ_APISERVER_TLS_ENABLED=true
SIGNOZ_APISERVER_TLS_CERT__FILE=<path-to-certificate>
SIGNOZ_APISERVER_TLS_KEY__FILE=<path-to-private-key>
SIGNOZ_APISERVER_TLS_MIN__VERSION=1.2Verify these values:
<path-to-certificate>: The path of the certificate file inside the SigNoz container.<path-to-private-key>: The path of the private key file inside the SigNoz container.
The SigNoz process must be able to read both files. Mount them into the SigNoz container with the method that your installation uses, such as a volume or a Kubernetes secret.
Validate
-
Send a request to the health endpoint over HTTPS:
curl --cacert <path-to-ca-certificate> https://<signoz-host>:8080/api/v1/healthThe response is
{"status":"ok"}. If your certificate comes from a public certificate authority, you can omit--cacert. -
Send the same request over plain HTTP:
curl -i http://<signoz-host>:8080/api/v1/healthThe response is
400 Bad Requestwith the bodyClient sent an HTTP request to an HTTPS server. -
Open
https://<signoz-host>:8080in your browser and sign in. If a private CA signed your certificate, or the certificate is self-signed, add the CA to the trust store of your operating system or browser first.
Verify these values:
<path-to-ca-certificate>: The path, on the machine where you runcurl, of the certificate authority (CA) file that signed your certificate. For a self-signed certificate, use the certificate itself, for examplecerts/server.crt.<signoz-host>: The hostname in your certificate. It must resolve to SigNoz.
After you enable TLS, change health checks, bookmarks, and API clients to use https://.
Configuration options
| Option | Environment variable | Description | Default |
|---|---|---|---|
apiserver.tls.enabled | SIGNOZ_APISERVER_TLS_ENABLED | Serve HTTPS instead of HTTP. | false |
apiserver.tls.cert_file | SIGNOZ_APISERVER_TLS_CERT__FILE | Path of the PEM-encoded certificate file. Required when enabled is true. | none |
apiserver.tls.key_file | SIGNOZ_APISERVER_TLS_KEY__FILE | Path of the PEM-encoded private key file. Required when enabled is true. | none |
apiserver.tls.min_version | SIGNOZ_APISERVER_TLS_MIN__VERSION | Minimum TLS version that SigNoz accepts, "1.2" or "1.3". | "1.2" |
If you set min_version to "1.3", clients that support only TLS 1.2 cannot connect.
If you run SigNoz with a configuration file, set the same options under apiserver.tls:
apiserver:
tls:
enabled: true
cert_file: <path-to-certificate>
key_file: <path-to-private-key>
min_version: "1.2"Troubleshooting
SigNoz does not start and logs failed to validate config "apiserver"
SigNoz logs this error when cert_file or key_file is empty, or when min_version has a value other than "1.2" or "1.3". The log does not say which option is wrong.
- Make sure that
SIGNOZ_APISERVER_TLS_CERT__FILEandSIGNOZ_APISERVER_TLS_KEY__FILEboth have a value. - Make sure that
SIGNOZ_APISERVER_TLS_MIN__VERSIONis1.2or1.3.
SigNoz does not start and logs cannot load tls::cert_file and tls::key_file
SigNoz cannot read the files, the files are not PEM-encoded, or the key does not match the certificate. The text after the colon gives the reason, for example no such file or directory.
- Make sure that the paths point to the files inside the container, not on the host.
- Make sure that the volume or the secret is mounted at that path.
- On a Docker host with SELinux in enforcing mode, add the
zlabel to the certificate volume mount, for example<host-path>:<container-path>:ro,z. See Docker SELinux.
The health check or the probes fail with status code 400
The Docker health check or the Kubernetes liveness and readiness probes still use plain HTTP. Docker marks the container unhealthy, and Kubernetes restarts the pod.
- In Docker, change the container health check to request
https://localhost:8080/api/v1/health. - In Kubernetes, set
scheme: HTTPSon the liveness and readiness probes. The SigNoz Helm chart uses custom probes only whenlivenessProbe.enabledandreadinessProbe.enabledarefalse.
If the pod is in CrashLoopBackOff when you run helm upgrade, the StatefulSet does not replace it. Delete the pod once, so that Kubernetes creates it with the new probes:
kubectl -n <namespace> delete pod <signoz-pod>Verify these values:
<signoz-pod>: The SigNoz pod, for examplesignoz-0. Runkubectl -n <namespace> get podsto find it.
Next steps
- Serving on an External URL: Serve SigNoz under a base path behind a reverse proxy.
- Configuration: See the other Self-Hosted SigNoz configuration options.
Get Help
If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack. If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.