config fix
This commit is contained in:
parent
66f88acae1
commit
586d3658b7
1 changed files with 15 additions and 15 deletions
|
@ -29,6 +29,21 @@ server {
|
||||||
return 403 "403 Forbidden (IP temporarily banned)\n";
|
return 403 "403 Forbidden (IP temporarily banned)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Apply general rate limit
|
||||||
|
limit_req zone=general burst=100 nodelay;
|
||||||
|
|
||||||
|
# Content Security Policy (needs to be per-domain)
|
||||||
|
add_header Content-Security-Policy "default-src 'self' *.$DOMAIN; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.$DOMAIN; style-src 'self' 'unsafe-inline' *.$DOMAIN; img-src 'self' data: *.$DOMAIN; font-src 'self' data: *.$DOMAIN; connect-src 'self' *.$DOMAIN; frame-src 'self' *.$DOMAIN; media-src 'self' *.$DOMAIN; object-src 'none'; base-uri 'self'; form-action 'self' *.$DOMAIN" always;
|
||||||
|
|
||||||
|
# Subdomain handling
|
||||||
|
set $subdomain '';
|
||||||
|
set $site_root "/var/www/$DOMAIN/_main";
|
||||||
|
if ($host ~* ^([^.]+)\.$DOMAIN$) {
|
||||||
|
set $subdomain $1;
|
||||||
|
set $site_root "/var/www/$DOMAIN/subdomains/$subdomain";
|
||||||
|
}
|
||||||
|
root "$site_root/www";
|
||||||
|
|
||||||
# Site-specific error pages
|
# Site-specific error pages
|
||||||
error_page 403 /site-error-page/403.html;
|
error_page 403 /site-error-page/403.html;
|
||||||
error_page 404 /site-error-page/404.html;
|
error_page 404 /site-error-page/404.html;
|
||||||
|
@ -52,21 +67,6 @@ server {
|
||||||
# Default error page config
|
# Default error page config
|
||||||
include snippets/error-pages.conf;
|
include snippets/error-pages.conf;
|
||||||
|
|
||||||
# Apply general rate limit
|
|
||||||
limit_req zone=general burst=100 nodelay;
|
|
||||||
|
|
||||||
# Content Security Policy (needs to be per-domain)
|
|
||||||
add_header Content-Security-Policy "default-src 'self' *.$DOMAIN; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.$DOMAIN; style-src 'self' 'unsafe-inline' *.$DOMAIN; img-src 'self' data: *.$DOMAIN; font-src 'self' data: *.$DOMAIN; connect-src 'self' *.$DOMAIN; frame-src 'self' *.$DOMAIN; media-src 'self' *.$DOMAIN; object-src 'none'; base-uri 'self'; form-action 'self' *.$DOMAIN" always;
|
|
||||||
|
|
||||||
# Subdomain handling
|
|
||||||
set $subdomain '';
|
|
||||||
set $site_root "/var/www/$DOMAIN/_main";
|
|
||||||
if ($host ~* ^([^.]+)\.$DOMAIN$) {
|
|
||||||
set $subdomain $1;
|
|
||||||
set $site_root "/var/www/$DOMAIN/subdomains/$subdomain";
|
|
||||||
}
|
|
||||||
root "$site_root/www";
|
|
||||||
|
|
||||||
# Basic settings
|
# Basic settings
|
||||||
index index.html index.htm index.php;
|
index index.html index.htm index.php;
|
||||||
client_max_body_size 20M;
|
client_max_body_size 20M;
|
||||||
|
|
Loading…
Reference in a new issue