fix redirect 301 bug

This commit is contained in:
Montech
2026-09-27 09:17:53 +03:30
parent 4f611d6fca
commit 1af5b555b8
2 changed files with 5 additions and 6 deletions
+3 -1
View File
@@ -90,12 +90,14 @@ docker run -d --name aria-imen-landing -p 8080:80 --restart unless-stopped aria-
**Nginx:**
```nginx
location = /index.html { return 301 /; }
location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; }
location / { try_files $uri $uri.html $uri/index.html =404; }
error_page 404 /404.html;
gzip on; gzip_types text/css application/javascript image/svg+xml;
```
ریدایرکت `location = /index.html { return 301 /; }` را نگذارید؛ با `index index.html` حلقهٔ ۳۰۱ روی `/` می‌سازد.
## پیش از دیپلوی واقعی — کارهایی که باید انجام دهید
این پروژه فعلاً با داده‌های تستی/placeholder برای موارد زیر ساخته شده و **باید قبل از انتشار واقعی بررسی و اصلاح شوند**:
+2 -5
View File
@@ -4,17 +4,14 @@ server {
root /usr/share/nginx/html;
index index.html;
location = /index.html {
return 301 /;
}
location /_next/static/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# $uri/index.html به‌جای $uri/ تا دایرکتوری / ریدایرکت ۳۰۱ نسازد
location / {
try_files $uri $uri.html $uri/ /404.html;
try_files $uri $uri.html $uri/index.html =404;
}
error_page 404 /404.html;