adding caddy configuration example (#154)

This commit is contained in:
Marty 2022-12-27 16:15:00 +01:00 committed by GitHub
parent ce0640e073
commit 27a1109bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 0 deletions

View file

@ -15,6 +15,7 @@
- [Getting started with Federation](administration/federation_getting_started.md) - [Getting started with Federation](administration/federation_getting_started.md)
- [Troubleshooting](administration/troubleshooting.md) - [Troubleshooting](administration/troubleshooting.md)
- [Backup and Restore](administration/backup_and_restore.md) - [Backup and Restore](administration/backup_and_restore.md)
- [Using Caddy as a reverse proxy](administration/caddy.md)
- [Moderation](moderation/moderation.md) - [Moderation](moderation/moderation.md)
- [Federation](federation/federation.md) - [Federation](federation/federation.md)
- [Federation Overview](federation/overview.md) - [Federation Overview](federation/overview.md)

View file

@ -20,3 +20,7 @@ In some cases, it might be necessary to use different installation methods. But
- [From Scratch](from_scratch.md) - [From Scratch](from_scratch.md)
- [Yunohost](https://install-app.yunohost.org/?app=lemmy) ([source code](https://github.com/YunoHost-Apps/lemmy_ynh)) - [Yunohost](https://install-app.yunohost.org/?app=lemmy) ([source code](https://github.com/YunoHost-Apps/lemmy_ynh))
- [On Amazon Web Services (AWS)](on_aws.md) - [On Amazon Web Services (AWS)](on_aws.md)
### You could use any other reverse proxy
An Example [Caddy configuration](caddy.md).

View file

@ -0,0 +1,51 @@
# Using Caddy as reverse proxy example
If you prefer to use Caddy instead of Nginx - you could use this template to fit into your needs:
```
(caddy-common) {
encode gzip
header {
-Server
Strict-Transport-Security "max-age=31536000; include-subdomains;"
X-XSS-Protection "1; mode=block"
X-Frame-Options "DENY"
X-Content-Type-Options nosniff
Referrer-Policy no-referrer-when-downgrade
X-Robots-Tag "none"
}
}
lemmy-site.com {
import caddy-common
reverse_proxy http://lemmy_lemmy-ui_1:1234
}
@lemmy {
path /api/*
path /pictrs/*
path /feeds/*
path /nodeinfo/*
path /.well-known/*
}
@lemmy-hdr {
header Accept application/*
}
handle @lemmy {
reverse_proxy http://lemmy_lemmy_1:8536
}
handle @lemmy-hdr {
reverse_proxy http://lemmy_lemmy_1:8536
}
@lemmy-post {
method POST
}
handle @lemmy-post {
reverse_proxy http://lemmy_lemmy_1:8536
}
```