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... + +
+ John Travolta confused +
+ +The page you're looking for might have been moved, renamed, or doesn't ..... exist? + +## Get back on track + +- [Home page](/) +- [Understanding Torus](/getting-started/understanding-torus/) +- [How-to Guides](/how-to-guides/table-of-contents/) +- [Explanations](/explanations/table-of-contents/) +- [Development](/development/table-of-contents/) + +## Send us a feedback + +If you clicked somewhere with a broken link, please, report back to us on [Discord](https://discord.gg/torus) or [Telegram](https://t.me/torusnetwork) +and tag some of our moderators. We will fix it as soon as possible. + +Here's the text for you to copy and paste: + +- **Problem**: [Replace with your problem] +- **Where you clicked**: [Replace with the URL you clicked, e.g in the docs somewhere, or in another website] +- **What you expected**: [Replace with what you expected to happen, either the correct link or the expected behavior] + + +Thank you very much for your feedback!