Files
vk-friseur/nginx.conf
T

70 lines
2.6 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
absolute_redirect off;
charset utf-8;
charset_types text/plain text/css application/javascript application/json application/xml image/svg+xml;
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types text/plain text/css application/javascript application/json application/ld+json application/xml text/xml image/svg+xml;
error_page 404 /404.html;
# Alte und frühere Adressen (Relaunch). Vor Livegang mit der Altseite abgleichen.
location = /leistungen { return 301 /leistungen-preise; }
location = /kontaktdaten { return 301 /kontakt; }
location = /hochzeitsservice { return 301 /brautservice; }
location = /braut { return 301 /brautservice; }
location = /balayage { return 301 /balayage-farbe; }
location = /haarverdichtung { return 301 /haarverlaengerung; }
location = /treuekarte { return 301 /kundenkarte; }
location = /herren { return 301 /barber; }
location = /karriere-jobs { return 301 /karriere; }
# Frühere Ortsseiten (Brückenseiten-Muster) zusammenführen
location = /friseur-tostedt { return 301 /; }
location = /friseur-buchholz-in-der-nordheide { return 301 /kontakt; }
location = /friseur-handeloh { return 301 /kontakt; }
location = /friseur-hollenstedt { return 301 /kontakt; }
location = /friseur-schneverdingen { return 301 /kontakt; }
# Abschließenden Schrägstrich entfernen (kanonische URLs ohne /)
rewrite ^/(.+)/$ /$1 permanent;
# Gehashte Build-Dateien: ein Jahr, unveränderlich
location ^~ /_astro/ {
include /etc/nginx/snippets/security-headers.conf;
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location ^~ /fonts/ {
include /etc/nginx/snippets/security-headers.conf;
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location ~* \.(?:png|jpg|jpeg|svg|ico|webp|avif)$ {
include /etc/nginx/snippets/security-headers.conf;
add_header Cache-Control "public, max-age=604800";
try_files $uri =404;
}
location / {
include /etc/nginx/snippets/security-headers.conf;
add_header Cache-Control "public, max-age=0, must-revalidate";
try_files $uri $uri/index.html $uri.html =404;
}
location = /404.html {
internal;
include /etc/nginx/snippets/security-headers.conf;
}
}