diff --git a/default.conf b/default.conf
index 9379eaa..2636219 100644
--- a/default.conf
+++ b/default.conf
@@ -12,7 +12,20 @@ server {
root /usr/share/nginx/html;
index index.html;
- location / {
- try_files $uri $uri/ =404;
+ # Отдельная страница ошибки 404
+ error_page 404 /404.html;
+
+ # Убираем .html из исходных запросов браузера
+ if ($request_uri ~ ^(/[^?]*)\.html(\?.*)?$) {
+ return 301 $1$is_args$args;
}
-}
+
+ location / {
+ try_files $uri $uri.html $uri/ =404;
+ }
+
+ # Доступ только для внутренней обработки ошибки
+ location = /404.html {
+ internal;
+ }
+}
\ No newline at end of file
diff --git a/html/404.html b/html/404.html
new file mode 100644
index 0000000..def5fef
--- /dev/null
+++ b/html/404.html
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+ ✦
+ 40🐦4
+ ✧
+ кажется, не тот кадр…
+
+ ОШИБКА 404 · СТРАНИЦА НЕ НАЙДЕНА
+ Эта страница
улетела из сюжета
+ Возможно, ссылка устарела или в адресе опечатка.
Но ваша история только начинается — вернёмся к ней?
+
+ Нужна идея? Посмотрите наши работы →
+
+
+
+
diff --git a/html/css/404.css b/html/css/404.css
new file mode 100644
index 0000000..76b760c
--- /dev/null
+++ b/html/css/404.css
@@ -0,0 +1,33 @@
+.error-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; background: radial-gradient(ellipse at 50% 30%, #f5d5c855, transparent 55%), #f9f7f0; }
+.error-header { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 26px; padding-bottom: 26px; }
+.error-contact { font-size: 13px; font-weight: 600; padding: 10px 0; }
+.error-contact:hover, .error-portfolio a:hover { color: #b30000; }
+.error-main { width: 100%; flex: 1; text-align: center; padding-top: 18px; padding-bottom: 64px; }
+.error-art { position: relative; isolation: isolate; width: min(100%, 530px); margin: 0 auto 28px; padding: 8px 0 35px; }
+.error-code { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: clamp(112px, 24vw, 200px); font-weight: 800; line-height: 1.15; letter-spacing: -.08em; color: #e60000; }
+.error-zero { position: relative; color: transparent; -webkit-text-stroke: 2px #e60000; }
+.error-bird { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .35em; letter-spacing: normal; -webkit-text-stroke: 0; color: #2c2c2c; transform: rotate(-12deg); }
+.error-orbit { position: absolute; z-index: -1; width: 88%; height: 65%; top: 14%; left: 6%; border: 1px dashed #cfa393; border-radius: 50%; transform: rotate(-13deg); }
+.error-spark { position: absolute; font-size: 30px; color: #b35d45; }
+.error-spark-one { top: 0; right: 9%; transform: rotate(15deg); }
+.error-spark-two { bottom: 38px; left: 8%; font-size: 40px; }
+.error-note { position: absolute; bottom: 0; right: 7%; font-family: 'Caveat', cursive; font-size: clamp(22px, 4vw, 30px); transform: rotate(-7deg); color: #795c50; }
+.error-eyebrow { color: #8b3b2d; font-weight: 600; font-size: 10px; letter-spacing: .15em; margin-bottom: 18px; }
+.error-main h1 { font-size: clamp(30px, 5.5vw, 48px); line-height: 1.17; letter-spacing: -.04em; font-weight: 800; margin-bottom: 22px; }
+.error-description { font-size: 15px; line-height: 1.8; color: #62605a; max-width: 580px; margin: 0 auto; }
+.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 30px auto 22px; }
+.error-actions .btn { gap: 22px; }
+.error-portfolio { font-size: 13px; color: #62605a; }
+.error-portfolio a { color: #2c2c2c; text-decoration: underline; text-underline-offset: 4px; }
+.error-footer { width: 100%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid #e5ded4; font-size: 11px; color: #68645e; }
+@media (max-width: 480px) {
+ .error-header { padding-top: 16px; padding-bottom: 16px; gap: 12px; }
+ .error-header .logo { font-size: 17px; gap: 4px; }
+ .error-contact { font-size: 11px; max-width: 110px; text-align: right; }
+ .error-main { padding-top: 28px; padding-bottom: 40px; }
+ .error-art { margin-bottom: 26px; }
+ .error-actions { flex-direction: column; max-width: 320px; }
+ .error-actions .btn { white-space: normal; }
+ .desktop-break { display: none; }
+ .error-footer { justify-content: center; text-align: center; }
+}