Add Nav, About/Projects pages and nginx hardening
CI / ci (push) Successful in 28s

Harden nginx: add CSP, HSTS, Referrer-Policy and Permissions-Policy;
include image/svg+xml in gzip types; set X-Content-Type-Options on
static assets; change try_files to return =404.

Add Nav component and wire into BaseLayout; add About and Projects
pages with projects.json, an initial blog post, and small layout/padding
adjustments (removed redundant back links).
This commit is contained in:
2026-03-04 19:53:13 +01:00
parent 50efbf6f57
commit 7fbe9a3e43
11 changed files with 738 additions and 60 deletions
+8 -4
View File
@@ -9,22 +9,26 @@ server {
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json image/svg+xml;
# Security headers
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 X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), interest-cohort=()" always;
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; connect-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
# Cache static assets
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
add_header X-Content-Type-Options "nosniff" always;
}
# Main location
location / {
try_files $uri $uri/ /index.html;
try_files $uri $uri/ =404;
}
# Custom error pages