Add custom nginx config
This commit is contained in:
parent
2d49ae5135
commit
de64e3c005
|
@ -6,3 +6,6 @@ trim_trailing_whitespace = true
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[nginx.conf]
|
||||||
|
indent_size = 4
|
||||||
|
|
|
@ -10,4 +10,5 @@ RUN npm run build
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY --from=builder /app/dist /usr/share/comfycamp
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
12
nginx.conf
Normal file
12
nginx.conf
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
server {
|
||||||
|
root /usr/share/comfycamp;
|
||||||
|
error_page 404 /404.html;
|
||||||
|
|
||||||
|
location ~ \.(png|ico|svg|ttf|webp)$ {
|
||||||
|
add_header Cache-Control "public, max-age=86400";
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/">Главная</a>
|
<a href="/">Главная</a>
|
||||||
<a href="/services">Сервисы</a>
|
<a href="/services/">Сервисы</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
8
src/pages/404.astro
Normal file
8
src/pages/404.astro
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
import Layout from '../layouts/Layout.astro'
|
||||||
|
---
|
||||||
|
|
||||||
|
<Layout title="Страница не найдена" description="Ошибка 404: такой страницы не существует">
|
||||||
|
<h1>404</h1>
|
||||||
|
<p>Такой страницы не существует :(</p>
|
||||||
|
</Layout>
|
|
@ -14,7 +14,11 @@ import Note from '../components/Note.astro'
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Заметки</h2>
|
<h2>Заметки</h2>
|
||||||
<Note date="27 августа 2023" title="Свободные альтернативы популярным сервисам" href="/notes/self-hosting" />
|
<Note
|
||||||
|
date="27 августа 2023"
|
||||||
|
title="Свободные альтернативы популярным сервисам"
|
||||||
|
href="/notes/self-hosting/"
|
||||||
|
/>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in a new issue