This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
limit_req_zone $binary_remote_addr zone=vacationplanner_ip_rate:1m rate=6r/m;
|
||||
limit_req_zone $server_name zone=vacationplanner_total_rate:1m rate=2r/s;
|
||||
limit_conn_zone $binary_remote_addr zone=vacationplanner_ip_conn:1m;
|
||||
limit_conn_zone $server_name zone=vacationplanner_total_conn:1m;
|
||||
|
||||
map $status $vacationplanner_retry_after {
|
||||
default "";
|
||||
429 60;
|
||||
}
|
||||
|
||||
map $status $vacationplanner_allow {
|
||||
default "";
|
||||
405 "GET, HEAD";
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name vacationplanner.popov.link;
|
||||
|
||||
access_log off;
|
||||
error_log /dev/null;
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
|
||||
return 301 https://vacationplanner.popov.link$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name vacationplanner.popov.link;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/popov.link/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/popov.link/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/popov.link/chain.pem;
|
||||
|
||||
root /var/www/vacationplanner;
|
||||
access_log off;
|
||||
error_log /dev/null;
|
||||
|
||||
# Defining a header here replaces the inherited add_header directives.
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
add_header Retry-After $vacationplanner_retry_after always;
|
||||
add_header Allow $vacationplanner_allow always;
|
||||
|
||||
if ($request_method !~ ^(GET|HEAD)$) {
|
||||
return 405;
|
||||
}
|
||||
|
||||
location = /calendar.ics {
|
||||
limit_req zone=vacationplanner_ip_rate burst=4 nodelay;
|
||||
limit_req zone=vacationplanner_total_rate burst=16 nodelay;
|
||||
limit_req_status 429;
|
||||
limit_conn vacationplanner_ip_conn 4;
|
||||
limit_conn vacationplanner_total_conn 16;
|
||||
limit_conn_status 429;
|
||||
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_hide_header Referrer-Policy;
|
||||
proxy_hide_header X-Content-Type-Options;
|
||||
proxy_read_timeout 65s;
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
proxy_max_temp_file_size 0;
|
||||
proxy_intercept_errors off;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user