diff --git a/docker_env/nginx/sites-enabled/daily.demo.conf b/docker_env/nginx/sites-enabled/daily.demo.conf index b063dab..eeb7d03 100644 --- a/docker_env/nginx/sites-enabled/daily.demo.conf +++ b/docker_env/nginx/sites-enabled/daily.demo.conf @@ -27,6 +27,13 @@ server { location / { try_files $uri $uri/ @router;#需要指向下面的@router否则会出现vue的路由在nginx中刷新出现404 root /dvadmin-ui/dist/; + add_header Cache-Control max-age=no-cache; + index index.html index.php index.htm; + } + location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ { + access_log off; + add_header Cache-Control max-age=604800; + root /dvadmin-ui/dist/; index index.html index.php index.htm; } location @router { diff --git a/docker_env/nginx/sites-enabled/demo.conf b/docker_env/nginx/sites-enabled/demo.conf index 65af5a0..a620990 100644 --- a/docker_env/nginx/sites-enabled/demo.conf +++ b/docker_env/nginx/sites-enabled/demo.conf @@ -27,6 +27,13 @@ server { location / { try_files $uri $uri/ @router;#需要指向下面的@router否则会出现vue的路由在nginx中刷新出现404 root /dvadmin-ui/dist/; + add_header Cache-Control max-age=no-cache; + index index.html index.php index.htm; + } + location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ { + access_log off; + add_header Cache-Control max-age=604800; + root /dvadmin-ui/dist/; index index.html index.php index.htm; } location @router {