fix redirect 301 bug
This commit is contained in:
@@ -90,12 +90,14 @@ docker run -d --name aria-imen-landing -p 8080:80 --restart unless-stopped aria-
|
|||||||
|
|
||||||
**Nginx:**
|
**Nginx:**
|
||||||
```nginx
|
```nginx
|
||||||
location = /index.html { return 301 /; }
|
|
||||||
location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; }
|
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;
|
error_page 404 /404.html;
|
||||||
gzip on; gzip_types text/css application/javascript image/svg+xml;
|
gzip on; gzip_types text/css application/javascript image/svg+xml;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
ریدایرکت `location = /index.html { return 301 /; }` را نگذارید؛ با `index index.html` حلقهٔ ۳۰۱ روی `/` میسازد.
|
||||||
|
|
||||||
## پیش از دیپلوی واقعی — کارهایی که باید انجام دهید
|
## پیش از دیپلوی واقعی — کارهایی که باید انجام دهید
|
||||||
|
|
||||||
این پروژه فعلاً با دادههای تستی/placeholder برای موارد زیر ساخته شده و **باید قبل از انتشار واقعی بررسی و اصلاح شوند**:
|
این پروژه فعلاً با دادههای تستی/placeholder برای موارد زیر ساخته شده و **باید قبل از انتشار واقعی بررسی و اصلاح شوند**:
|
||||||
|
|||||||
+2
-5
@@ -4,17 +4,14 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
location = /index.html {
|
|
||||||
return 301 /;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /_next/static/ {
|
location /_next/static/ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $uri/index.html بهجای $uri/ تا دایرکتوری / ریدایرکت ۳۰۱ نسازد
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri.html $uri/ /404.html;
|
try_files $uri $uri.html $uri/index.html =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
|
|||||||
Reference in New Issue
Block a user