Files
floorithardwoodfloors.com/nginx.conf
T
Concept Agent 88ed4e6bda Align with AM stack SOPs: required files, nginx hardening, mobile CSS
- Add robots.txt, sitemap.xml (16 pages), 404.html, 500.html per SOP
- nginx: allow robots.txt/sitemap.xml explicitly, fix error_page to 404.html, deny _template.html, remove txt from deny list, fix API proxy comment
- Convert residential.png to residential.webp per image SOP
- components.css: mobile nav breakpoint 768→1023px, 360px ultra-narrow query, overflow-x:clip, inline grid collapse overrides
- blog/index.html: placeholder blog listing page with 3 article cards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 18:53:35 +02:00

64 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Deny dotfiles, configs, scripts, source — defense in depth
location ~ /\. {
deny all;
return 404;
}
location ~* \.(env|env\.example|conf|yml|yaml|py|pyc|md|sh|sql|log|bak|old|swp|dockerfile)$ {
deny all;
return 404;
}
location = /Dockerfile {
deny all;
return 404;
}
location ~* /_template\.html$ {
deny all;
return 404;
}
location = /robots.txt { access_log off; }
location = /sitemap.xml { access_log off; }
# API proxy — strip /api/ prefix, forward to Python API service
location /api/ {
proxy_pass http://api:3001/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 10s;
proxy_connect_timeout 5s;
}
# Flat HTML — serve /locations/buffalo as /locations/buffalo.html
location / {
try_files $uri $uri/ $uri.html =404;
}
# Cache static assets
location ~* \.(jpg|jpeg|png|webp|svg|ico|css|js|woff2?|mp4|webm)$ {
expires 30d;
add_header Cache-Control "public, immutable";
access_log off;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "strict-origin-when-cross-origin";
# Gzip
gzip on;
gzip_types text/html text/css application/javascript image/svg+xml;
gzip_min_length 1024;
error_page 404 /404.html;
}