---
title: 'Reverse proxy and HTTPS'
url: 'https://chronoslice.app/docs/installing/reverse-proxy-and-https'
markdown: 'https://chronoslice.app/docs/installing/reverse-proxy-and-https.md'
date: '2026-11-14'
description: 'ChronoSlice speaks plain HTTP on 127.0.0.1:7340. A reverse proxy on the same server takes the public HTTPS traffic and passes it on. This page gives a working Caddy setup and a working nginx setup, then the two ChronoSlice settings that go with them. What the proxy has to do Pass requests to 127.0…'
taxonomy:
  kb_category:
    - Installing
---

[Docs](https://chronoslice.app/docs)

 [Contact support](https://chronoslice.app/help/new) 

Docs menu

# Reverse proxy and HTTPS

Serve ChronoSlice over HTTPS with Caddy or nginx, and set the two settings that go with it.

 Updated Nov 14, 2026 4 min read

ChronoSlice speaks plain HTTP on `127.0.0.1:7340`. A reverse proxy on the same server takes the public HTTPS traffic and passes it on. This page gives a working Caddy setup and a working nginx setup, then the two ChronoSlice settings that go with them.

## What the proxy has to do

- **Pass requests to `127.0.0.1:7340`** and handle the certificate.
- **Keep the `Host` header as the browser sent it.** ChronoSlice refuses a change made from a browser when the page's address doesn't match the `Host` header it receives. If the proxy replaces `Host` with `127.0.0.1:7340`, every save fails with "You don't have permission to do that."
- **Allow uploads of about 10 MB.** Invoice attachments can be up to 10 MB each.
- **Not buffer the live updates stream.** The web app and the Mac app keep `/api/orgs/{org}/events` open and pull when the server says something changed. It's a server-sent events stream, and the server sends a keep-alive every 20 seconds.

Open ports 80 and 443 in your firewall. Don't open 7340.

## Caddy

Caddy gets and renews certificates by itself and keeps the `Host` header. It passes the live updates stream through as it is, so nothing else is needed. Install Caddy from its Debian repository (see [caddyserver.com/docs/install](https://caddyserver.com/docs/install)), then put this in `/etc/caddy/Caddyfile`:

```caddy
time.example.com {
    encode zstd gzip
    reverse_proxy 127.0.0.1:7340
}
```

Reload it:

```sh
sudo systemctl reload caddy
```

## nginx

Get a certificate first, with Certbot or your usual tool. The paths below are where Certbot puts them. Put this in `/etc/nginx/sites-available/chronoslice` and link it into `sites-enabled`:

```nginx
server {
    listen 80;
    server_name time.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    http2 on;
    server_name time.example.com;

    ssl_certificate     /etc/letsencrypt/live/time.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/time.example.com/privkey.pem;

    client_max_body_size 11m;

    location / {
        proxy_pass http://127.0.0.1:7340;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Live updates (server-sent events): don't hold the stream back.
    location ~ ^/api/orgs/[^/]+/events$ {
        proxy_pass http://127.0.0.1:7340;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_buffering off;
    }
}
```

Check the file and reload:

```sh
sudo nginx -t && sudo systemctl reload nginx
```

Three lines in that file matter:

- `proxy_set_header Host $http_host;` passes the address on exactly as the browser sent it. Without it, nginx sends `127.0.0.1:7340` and saving anything in the browser fails with a 403. `$host` works too while nginx listens on 443, but it drops any other port, with the same 403.
- `client_max_body_size 11m;` raises nginx's 1 MB default, which would reject invoice attachments.
- `proxy_buffering off;` on the events path. ChronoSlice doesn't send an `X-Accel-Buffering: no` header, so nginx is left to decide, and with buffering on it holds the live updates back. In a test on nginx 1.31, nothing arrived at all when the browser connected over HTTP/1.1, and other people's changes only showed after a reload. Over HTTP/2 the events happened to get through, but don't rely on it.

## Tell ChronoSlice about the address

Two settings in `/etc/chronoslice/env` go with HTTPS:

```ini
CHRONOSLICE_PUBLIC_URL=https://time.example.com
CHRONOSLICE_SECURE_COOKIES=true
```

- **`CHRONOSLICE_PUBLIC_URL`** is the address people reach ChronoSlice at. Emails use it for links to invoices, Stripe sends clients back to it, and it's the base of the Stripe webhook address. A trailing slash is removed. Without it, emails can't link to invoices and the Stripe webhook can't be set up.
- **`CHRONOSLICE_SECURE_COOKIES=true`** marks the session cookie Secure, so browsers send it only over HTTPS. Use `true`, not `1` or `yes`. Leave it off only while you test over plain HTTP, because a browser won't keep a Secure cookie from an `http://` address.

Restart ChronoSlice after changing them:

```sh
sudo systemctl restart chronoslice
```

## Check it

```sh
curl -sI https://time.example.com | head -1
```

You should see `HTTP/2 200`. Then open the address in a browser. A new install shows the setup page. See [The first account](https://chronoslice.app/docs/installing/the-first-account).

If sign-in works but saving anything fails, the proxy is changing the `Host` header. See [Troubleshooting](https://chronoslice.app/docs/help/troubleshooting).

## Related

- [Install on macOS](https://chronoslice.app/docs/installing/install-on-macos)
- [Troubleshooting](https://chronoslice.app/docs/help/troubleshooting)
- [Install on Linux](https://chronoslice.app/docs/installing/install-on-linux)

## Still stuck?

Send us a request: it goes to the people who build ChronoSlice, and the reply comes by email. Include your ChronoSlice version (Settings › Licence shows it) and what you tried.

 [Contact support](https://chronoslice.app/help/new?from=%2Fdocs%2Finstalling%2Freverse-proxy-and-https)[Your requests](https://chronoslice.app/help/tickets)

---

## Navigation

- Parent: [Installing](https://chronoslice.app/docs/installing.md)
- Previous: [Run with Docker](https://chronoslice.app/docs/installing/run-with-docker.md)
- Next: [The first account](https://chronoslice.app/docs/installing/the-first-account.md)
