Big performance improvement! Added Caddyfile, using Caddy's file server to serve large files instead of PHP
This commit is contained in:
parent
92362efd47
commit
10502157a3
4 changed files with 73 additions and 3 deletions
38
Caddyfile
Normal file
38
Caddyfile
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
frankenphp {
|
||||
num_threads {$FRANKENPHP_NUM_THREADS:8}
|
||||
max_threads {$FRANKENPHP_MAX_THREADS:16}
|
||||
}
|
||||
|
||||
servers {
|
||||
trusted_proxies static private_ranges
|
||||
}
|
||||
}
|
||||
|
||||
{$FREAX_SITE_ADDR::9000} {
|
||||
root * {$FREAX_DOCROOT:/home/user/freax-media}
|
||||
|
||||
encode zstd gzip
|
||||
|
||||
@static path /assets/* /freaxlogo.png
|
||||
handle @static {
|
||||
file_server
|
||||
}
|
||||
|
||||
handle_path /media/* {
|
||||
@allowed_media path_regexp allowed_media (?i).*\.(mp4|mkv|avi|mov|wmv|flv|webm|m4v|mp3|wav|ogg|flac|m4a|aac|wma|opus)$
|
||||
handle @allowed_media {
|
||||
root * {$FREAX_MEDIA_ROOT:/__FREAX_MEDIA_ROOT_NOT_SET__}
|
||||
forward_auth {$FREAX_AUTH_UPSTREAM:127.0.0.1:9000} {
|
||||
uri /authz_media.php
|
||||
}
|
||||
file_server
|
||||
}
|
||||
|
||||
respond "Forbidden" 403
|
||||
}
|
||||
|
||||
php_server
|
||||
file_server
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue