Skip to content

Commit 468737b

Browse files
committed
add caddy instructions
1 parent ec869cc commit 468737b

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

docs/reverse-proxy/caddy/caddy.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Caddy
3+
---
4+
5+
# Caddy
6+
7+
Want to use [**caddy**](https://github.com/caddyserver/caddy) as your **Reverse Proxy**?
8+
These instructions will take you through the steps.
9+
10+
## Prerequisites
11+
12+
Before moving on you must have
13+
14+
- some knowledge of **caddy**
15+
- already deployed **caddy**
16+
17+
## Installation
18+
19+
Create or update your `Caddyfile` file and mount it to `/etc/caddy/Caddyfile` in your caddy container.
20+
21+
```conf
22+
{{{ #://./examples/Caddyfile }}}
23+
```
24+
25+
Then spin up your stack:
26+
27+
```bash
28+
docker compose up -d
29+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Replace with your actual domain
2+
domain.com {
3+
# Use whatever network alias you set in the docker-compose file
4+
reverse_proxy secured-signal-api:8880
5+
6+
# Optional: basic security headers
7+
header {
8+
Strict-Transport-Security "max-age=31536000;"
9+
X-Content-Type-Options "nosniff"
10+
X-Frame-Options "DENY"
11+
Referrer-Policy "no-referrer"
12+
}
13+
}
14+
15+
# HTTP redirect to HTTPS
16+
http://domain.com {
17+
redir https://{host}{uri} permanent
18+
}

docs/reverse-proxy/nginx/examples/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ server {
44

55
# Add allowed hostnames which nginx should respond to
66
# `_` for any
7-
server_name localhost;
7+
server_name domain.com;
88

99
ssl_certificate /etc/nginx/ssl/cert.crt;
1010
ssl_certificate_key /etc/nginx/ssl/cert.key;
@@ -23,6 +23,6 @@ server {
2323
# Redirect HTTP to HTTPs
2424
server {
2525
listen 80;
26-
server_name localhost;
26+
server_name domain.com;
2727
return 301 https://$host$request_uri;
2828
}

0 commit comments

Comments
 (0)