forked from noxious/client
format
This commit is contained in:
parent
723aa59142
commit
87e7f14469
102
Caddyfile
102
Caddyfile
@ -1,70 +1,70 @@
|
|||||||
{
|
{
|
||||||
# Global options
|
# Global options
|
||||||
admin off # Disable admin API
|
admin off # Disable admin API
|
||||||
|
|
||||||
# Global logging configuration
|
# Global logging configuration
|
||||||
log {
|
log {
|
||||||
output file /var/log/caddy/access.log
|
output file /var/log/caddy/access.log
|
||||||
format json
|
format json
|
||||||
level INFO
|
level INFO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noxious.gg {
|
noxious.gg {
|
||||||
# Root directory for your Vue app
|
# Root directory for your Vue app
|
||||||
root * ./dist
|
root * ./dist
|
||||||
|
|
||||||
# Enable compression with optimal settings
|
# Enable compression with optimal settings
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
|
|
||||||
# Handle SPA routing
|
# Handle SPA routing
|
||||||
try_files {path} /index.html
|
try_files {path} /index.html
|
||||||
|
|
||||||
# Serve static files with optimizations
|
# Serve static files with optimizations
|
||||||
file_server
|
file_server
|
||||||
|
|
||||||
# Enhanced security headers
|
# Enhanced security headers
|
||||||
header {
|
header {
|
||||||
# Existing headers with improvements
|
# Existing headers with improvements
|
||||||
X-Frame-Options "SAMEORIGIN"
|
X-Frame-Options "SAMEORIGIN"
|
||||||
X-XSS-Protection "1; mode=block"
|
X-XSS-Protection "1; mode=block"
|
||||||
X-Content-Type-Options "nosniff"
|
X-Content-Type-Options "nosniff"
|
||||||
Referrer-Policy "strict-origin-when-cross-origin"
|
Referrer-Policy "strict-origin-when-cross-origin"
|
||||||
|
|
||||||
# Additional security headers
|
# Additional security headers
|
||||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||||
Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()"
|
Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()"
|
||||||
|
|
||||||
# Remove server information
|
# Remove server information
|
||||||
-Server
|
-Server
|
||||||
}
|
}
|
||||||
|
|
||||||
# Improved cache configuration for static assets
|
# Improved cache configuration for static assets
|
||||||
@static {
|
@static {
|
||||||
file
|
file
|
||||||
path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot
|
path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot
|
||||||
}
|
}
|
||||||
header @static {
|
header @static {
|
||||||
Cache-Control "public, max-age=31536000, immutable"
|
Cache-Control "public, max-age=31536000, immutable"
|
||||||
Vary Accept-Encoding
|
Vary Accept-Encoding
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cache control for HTML files
|
# Cache control for HTML files
|
||||||
@html {
|
@html {
|
||||||
file
|
file
|
||||||
path *.html
|
path *.html
|
||||||
}
|
}
|
||||||
header @html {
|
header @html {
|
||||||
Cache-Control "no-cache, must-revalidate"
|
Cache-Control "no-cache, must-revalidate"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle errors
|
# Handle errors
|
||||||
handle_errors {
|
handle_errors {
|
||||||
respond "{http.error.status_code} {http.error.status_text}" {http.error.status_code}
|
respond "{http.error.status_code} {http.error.status_text}" {http.error.status_code}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Improved redirect configuration
|
# Improved redirect configuration
|
||||||
www.noxious.gg {
|
www.noxious.gg {
|
||||||
redir https://noxious.gg{uri} permanent
|
redir https://noxious.gg{uri} permanent
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user