diff --git a/Dockerfile b/Dockerfile index c63b72f..c860755 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ FROM nginx:alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf COPY dist /usr/share/nginx/html \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..23e745a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,30 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Enable gzip compression + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json; + + # 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; + + # Custom 404 page + error_page 404 /404.html; + + location / { + try_files $uri $uri/ $uri.html =404; + } + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +} diff --git a/src/assets/travolta-lost.gif b/src/assets/travolta-lost.gif new file mode 100644 index 0000000..30d4775 Binary files /dev/null and b/src/assets/travolta-lost.gif differ diff --git a/src/content/docs/404.mdx b/src/content/docs/404.mdx new file mode 100644 index 0000000..fa58e04 --- /dev/null +++ b/src/content/docs/404.mdx @@ -0,0 +1,37 @@ +--- +title: 404 - Page not found +description: The page you're looking for doesn't exist +--- + +import RedText from '/src/components/RedText.astro'; +import travoltaGif from '../../assets/travolta-lost.gif'; + +# Looks like you are lost... + +