48 lines
1.6 KiB
Nginx Configuration File
48 lines
1.6 KiB
Nginx Configuration File
server_tokens off;
|
|
|
|
map $remote_addr $ip_anon {
|
|
~(?P<ip>\d+\.\d+\.\d+)\.\d+ $ip.0;
|
|
~(?P<ip>[^:]+:[^:]+): $ip::;
|
|
default 0.0.0.0;
|
|
}
|
|
log_format anon '$ip_anon [$time_local] "$request" $status $body_bytes_sent';
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name acampada26s.net www.acampada26s.net;
|
|
return 301 https://acampada26s.net$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name acampada26s.net www.acampada26s.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/acampada26s.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/acampada26s.net/privkey.pem;
|
|
|
|
access_log /var/log/nginx/acampada26s.access.log anon;
|
|
|
|
root /var/www/acampada26s.net;
|
|
index index.html;
|
|
|
|
add_header Content-Security-Policy "default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" always;
|
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), interest-cohort=()" always;
|
|
|
|
location / {
|
|
limit_except GET HEAD { deny all; }
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location ~* \.(css|woff2|jpg|jpeg|png|webp)$ {
|
|
limit_except GET HEAD { deny all; }
|
|
expires 7d;
|
|
}
|
|
|
|
location = /c { include /etc/nginx/snippets/acampada26s-hub.conf; }
|
|
location ^~ /c/ { include /etc/nginx/snippets/acampada26s-hub.conf; }
|
|
}
|