Skip to content

Commit 38f7ef8

Browse files
authored
Clarify how to edit hosts for each OS #3
2 parents c607b50 + 2884514 commit 38f7ef8

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

CLAUDE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ A Caddy-based reverse proxy for local development with automatic SSL certificate
1616

1717
```bash
1818
# Generate certificates (first time only)
19-
docker-compose --profile setup run --rm mkcert
19+
docker compose --profile setup run --rm mkcert
2020

2121
# Start the proxy
22-
docker-compose up -d --build
22+
docker compose up -d --build
2323

2424
# View logs
25-
docker-compose logs -f caddy
25+
docker compose logs -f caddy
2626

2727
# Stop the proxy
28-
docker-compose down
28+
docker compose down
2929

3030
# Regenerate certificates
31-
rm -rf certs/* && docker-compose --profile setup run --rm mkcert
31+
rm -rf certs/* && docker compose --profile setup run --rm mkcert
3232

3333
# Install CA on macOS
3434
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./certs/${DOMAIN}.rootCA.pem

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,29 @@ A Dockerized Caddy reverse proxy with automatic SSL certificate generation for l
1818
UPSTREAM_URL=http://host.docker.internal:3000
1919
```
2020

21-
`UPSTREAM_URL` must include the scheme and port.
21+
> [!WARNING]
22+
> `UPSTREAM_URL` must include the scheme and port.
2223
23-
2. Add to `/etc/hosts`:
24+
2. Add your domain to the hosts file:
2425

26+
**macOS/Linux:**
27+
Edit `/etc/hosts`
28+
29+
```bash
30+
sudo sh -c 'echo "127.0.0.1 local.example.com" >> /etc/hosts'
2531
```
26-
127.0.0.1 local.example.com
32+
33+
**Windows (PowerShell as Administrator):**
34+
Edit `C:\Windows\System32\drivers\etc\hosts`
35+
36+
```powershell
37+
Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "127.0.0.1 local.example.com"
2738
```
2839

2940
3. Generate certificates (first time only):
3041

3142
```bash
32-
docker-compose --profile setup run --rm mkcert
43+
docker compose --profile setup run --rm mkcert
3344
```
3445

3546
4. Install the CA certificate (one-time):

0 commit comments

Comments
 (0)