Files
api/README.md
T
Jeppe Bundgaard d7a8fc1d1c Add Nginx TLS configuration, structured logging, PHP-FPM upstream, and Filebeat integration
- Configure Nginx to use structured JSON access logs and add request ID headers.
- Define upstream pool for PHP-FPM with load-balancing support.
- Integrate Filebeat for log ingestion across Nginx and PHP logs.
- Add `.env.example` and README for local TLS setup guidance.
- Extend Dockerfile with PHP extensions (GD, Redis, etc.) and Composer dependency installs.
- Add custom PHP configuration for Redis-backed session storage.
2026-02-13 21:10:50 +01:00

36 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### Local TLS certificates with Docker Compose
Nginx is configured to terminate TLS using certificates mounted at `/etc/letsencrypt` inside the container. To use your real Lets Encrypt certificates on the host, the Compose file mounts a configurable path via `LETSENCRYPT_PATH`.
#### 1) Configure the host certificate path
Copy `.env.example` to `.env` in the project root and adjust the path for your environment:
```
cp .env.example .env
# Edit .env and set one of the following:
# Linux: LETSENCRYPT_PATH=/etc/letsencrypt
# Windows (WSL Ubuntu): LETSENCRYPT_PATH=//wsl$/Ubuntu/etc/letsencrypt
```
Ensure the following files exist under the path you set:
- `live/api.truckwash.dk/fullchain.pem`
- `live/api.truckwash.dk/privkey.pem`
- `live/cloud.truckwash.dk/fullchain.pem`
- `live/cloud.truckwash.dk/privkey.pem`
If you dont have certs for `cloud.truckwash.dk` locally, either comment out that TLS server block in `services/nginx/nginx.conf` or place a temporary selfsigned cert/key at the expected path.
#### 2) Start Nginx
```
docker compose up -d nginx
```
Check logs:
```
docker compose logs -f nginx
```
#### 3) Troubleshooting
- “cannot load certificate … no such file or directory”: verify `LETSENCRYPT_PATH` and that all `live/<domain>/` files exist on the host.
- For purely local testing without HTTPS, you may comment out the HTTPS server blocks and the HTTP→HTTPS redirect in `services/nginx/nginx.conf` and run on port 80.