fix: admin nginx 容器路由(dist 在根路径,/admin/ 前缀 rewrite)
This commit is contained in:
@@ -3,11 +3,14 @@ server {
|
|||||||
server_name _;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
location = / { return 302 /admin/; }
|
||||||
location /admin/ {
|
location /admin/ {
|
||||||
try_files $uri $uri/ /admin/index.html;
|
rewrite ^/admin/(.*)$ /$1 last;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
location = /admin { return 301 /admin/; }
|
|
||||||
location = / { return 301 /admin/; }
|
|
||||||
location ~* \.(js|css|png|jpg|svg|woff2?)$ {
|
location ~* \.(js|css|png|jpg|svg|woff2?)$ {
|
||||||
expires 30d;
|
expires 30d;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
|
|||||||
Reference in New Issue
Block a user