Files
dealplustech-astroreal/nginx.conf
Kunthawat Greethong 52030b7d46 fix(armaflex): rename misspelled 'armflex' slug to 'armaflex' everywhere
- Route /armflex -> /armaflex (page file + nav/listing links)
- Image folder public/images/armflex/ -> public/images/armaflex/
- Fix gallery alt-text 'Armflex' -> 'Armaflex'
- Add nginx 301 redirect so old /armflex URL still works (SEO-safe)
- Update engineering log + handoff

Verified: npm run build (44 pages), tsc --noEmit, nginx -t,
live probe /armaflex/ 200, zero stale 'armflex' refs.
2026-09-08 17:52:12 +07:00

60 lines
1.5 KiB
Nginx Configuration File

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
# gzip
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types
text/plain
text/css
text/javascript
text/xml
application/javascript
application/json
application/xml
application/xml+rss
image/svg+xml
font/ttf
font/otf;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Cache static assets aggressively (Astro hashes filenames)
location ~* \.(?:js|css|woff2?|ttf|otf|eot|svg|jpg|jpeg|png|webp|avif|ico)$ {
expires 1y;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
# 301 redirect: old misspelled product slug (armflex -> armaflex)
location = /armflex { return 301 /armaflex; }
location = /armflex/ { return 301 /armaflex; }
# Don't cache HTML
location ~* \.html$ {
expires -1;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Thai URL slugs (Astro file-based routing produces paths with UTF-8 chars)
location / {
try_files $uri $uri/ $uri.html /index.html;
}
# healthcheck
location /healthz {
access_log off;
return 200 "ok\n";
add_header Content-Type text/plain;
}
}