mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-06 16:32:35 +00:00
Add Caddy Server Support Alongside Nginx (#600)
* added enum * add config for caddy * add svg icon * add caddy service class * wip * install caddy * create base Caddyfile with common snippets * Create a systemd service to run Caddy in the background. * create uninstall file * wip * create path * create vhost * get vhost * delete site * add php version change file * add custom ssl * create redirect file * add vhost for caddy site & load balancer * update svg * fix caddy icon * fix style * add systemctl reload method * Reload systemd after modifying the Caddy service file. * add caddy * added tests * format with pint * prevent multiple web server installations * added error log & access log
This commit is contained in:
59
resources/views/ssh/services/webserver/caddy/caddy.blade.php
Executable file
59
resources/views/ssh/services/webserver/caddy/caddy.blade.php
Executable file
@ -0,0 +1,59 @@
|
||||
{
|
||||
# Global Errors Log
|
||||
log {
|
||||
output file /var/log/caddy/errors.log {
|
||||
roll_size 100MB
|
||||
roll_keep 10
|
||||
roll_keep_for 720h # 30 days
|
||||
}
|
||||
format json {
|
||||
time_format iso8601
|
||||
}
|
||||
level ERROR
|
||||
exclude http.log.access
|
||||
}
|
||||
}
|
||||
|
||||
# Common snippets
|
||||
(access_log) {
|
||||
log {
|
||||
output file /var/log/caddy/{args[0]}-access.log {
|
||||
roll_size 100MB
|
||||
roll_keep 10
|
||||
roll_keep_for 720h # 30 days
|
||||
}
|
||||
format json {
|
||||
time_format iso8601
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(security_headers) {
|
||||
header {
|
||||
# Remove server and software information
|
||||
-Server
|
||||
-X-Powered-By
|
||||
-Via
|
||||
|
||||
# Security headers
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Content-Security-Policy "upgrade-insecure-requests"
|
||||
|
||||
# Enable compression
|
||||
defer
|
||||
}
|
||||
}
|
||||
|
||||
(compression) {
|
||||
encode {
|
||||
gzip 6
|
||||
zstd
|
||||
minimum_length 1024
|
||||
}
|
||||
}
|
||||
|
||||
import sites-enabled/*
|
Reference in New Issue
Block a user