Skip to content

Instantly share code, notes, and snippets.

@tscs37

tscs37/Caddyfile Secret

Created December 30, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tscs37/0649b61d77fd165599ecc477bfd5136a to your computer and use it in GitHub Desktop.
Save tscs37/0649b61d77fd165599ecc477bfd5136a to your computer and use it in GitHub Desktop.
url.domain.invalid {
log /var/log/caddy/access.log {
rotate {
size 50
age 30
keep 5
}
}
errors {
log /var/log/caddy/error.log {
size 50
age 30
keep 5
}
}
tls nc.letsencrypt-ca@domain.invalid
maxrequestbody 500MB
root /var/www/nextcloud
#fastcgi / unix:/run/php/php7.0-fpm.sock php {
# env PATH /bin
# pool 1
# connect_timeout 10s
# read_timeout 1m
# write_timeout 1m
#}
# Query Rewrite
rewrite {
r ^/index.php/.*$
to /index.php?{query}
}
# Client Support CalDav
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
# DAV Rewrite
rewrite {
r ^/remote.php/(webdav|caldav|carddav)(\/?)$
to /remote.php/{1}
}
rewrite {
r ^/remote.php/(webdav|caldav|carddav)/(.+)(\/?)$
to /remote.php/{1}/{2}
}
# Protect Files
rewrite {
r ^/(?:\.htaccess|data|config|db_structure\.xml|README)
to /403-not-allowed
}
status 403 {
/403-not-allowed
}
header / Strict-Transport-Security "max-age=31536000;"
fastcgi / unix:/run/php/php7.0-fpm.sock php {
env PATH /bin
pool 1
connect_timeout 10s
read_timeout 1m
write_timeout 1m
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment