diff --git a/README.md b/README.md index 0a1682e..769927f 100644 --- a/README.md +++ b/README.md @@ -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 برای موارد زیر ساخته شده و **باید قبل از انتشار واقعی بررسی و اصلاح شوند**: diff --git a/nginx.conf b/nginx.conf index 302f7e6..9275816 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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;