location ^~/html/dist {
#alias /home/server/webapps/vuejs-admin/;
index index.html;
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^/(html/dist)/(.+)$ /$1/index.html last;
}

Apache

 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /html/dist/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /html/dist/index.html [L]
</IfModule>

  

Vue NGINX Apache 404 问题解决的更多相关文章

  1. nginx+apache 404错误页面

    公司新系统  随风做的  给客户演示出错不想让客户看到   自动返回上一页面. 刚开始按照网上说的 在nginx 处理: # 定义错误提示页面 error_page 500 502 503 504 / ...

  2. vue + nginx部署404

    记录: vue项目打包放到服务器,使用nginx反向代理的时候路由页面刷新报404,因为刷新时,不存在路径对应的文件或文件夹,需要在nginx配置中添加代码: index index.html; tr ...

  3. wordpress配置固定链接nginx访问404问题解决方法

    WordPress支持使用固定链接,但是在ngnix环境下,访问页面后出现404, 其实官方是有文档说明的,需要单独写配置, 我这边配置的示例代码如下: server { listen       8 ...

  4. SpringBoot + Vue + nginx项目部署(零基础带你部署)

    一.环境.工具 jdk1.8 maven spring-boot idea VSVode vue 百度网盘(vue+springboot+nginx源码): 链接:https://pan.baidu. ...

  5. NGINX 配置404错误页面转向

    什么是404页面 如果碰巧网站出了问题,或者用户试图访问一个并不存在的页面时,此时服务器会返回代码为404的错误信息,此时对应页面就是404页面.404页面的默认内容和具体的服务器有关.如果后台用的是 ...

  6. nginx error_page 404 用 php header 无法跳转

    nginx error_page 404 用 php header 无法跳转 之前用Apache的时候,只需要设置 ErrorDocument 404 /404.php 就可以在 404.php 中根 ...

  7. NGINX 配置404错误页面转向

    什么是404页面 如果碰巧网站出了问题,或者用户试图访问一个并不存在的页面时,此时服务器会返回代码为404的错误信息,此时对应页面就是404页面.404页面的默认内容和具体的服务器有关.如果后台用的是 ...

  8. linux上nginx+apache 搭建 svn服务器

    众所周知,nginx目前是不支持svn的,并且由于机房网络只开了80和22(ssh)端口,所以这时候就没法单独在服务器上搭建apache+svn .所以就产生了 nginx + apache + sv ...

  9. Nginx 笔记与总结(15)nginx 实现反向代理 ( nginx + apache 动静分离)

    在 nginx 中,proxy 用来实现反向代理,upstream 用来实现负载均衡. 例如有两台服务器,nginx 服务器作为代理服务器,执行 .html 文件,apache 服务器上执行 .php ...

随机推荐

  1. JAVA 时间转换、获取

    /** * 将字符串格式的时间转换成Timestamp * * @param time * @param formatStyle * @return */ public static Timestam ...

  2. Elasticsearch 概念理解

    官方文档地址 Filebeat: https://www.elastic.co/cn/products/beats/filebeat https://www.elastic.co/guide/en/b ...

  3. appuploader 使用

    mac 使用 Jar Lanucher.app 打开 解压后的 appuploader.jar 文件,即可启动 appuploader. 内容 网址 官方网站 http://www.appupload ...

  4. MIME Type介绍 Content-Type 各种定义

    多用途互联网邮件扩展(MIME,Multipurpose Internet Mail Extensions)是一个互联网标准,它扩展了电子邮件标准,使其能够支持非ASCII字符.二进制格式附件等多种格 ...

  5. React Virtual DOM Explained in Simple English

    If you are using React or learning React, you must have heard of the term “Virtual DOM”. Now what is ...

  6. fitnesse管理引进的jar包

    如下:需要引进的jar很多,并且路径都不一样,这样增加删减jar就比较麻烦 !*> setup!define TEST_SYSTEM {slim}!define LOCAL_PATH  {C:\ ...

  7. 文件夹上传组件webupload插件

    javaweb上传文件 上传文件的jsp中的部分 上传文件同样可以使用form表单向后端发请求,也可以使用 ajax向后端发请求 1.通过form表单向后端发送请求 <form id=" ...

  8. 从Hello World 来讲解线程

    从一个经典的例子开始:一个打印“Hello World.”的程序.一个非常简单的在单线程中运行的Hello World程序如下所示,当我们谈到多线程时,它可以作为一个基准. #include<i ...

  9. java读取文件夹下文件及txt内容

    public class PositionController {     // 读取txt内容     public static String txt2String(File file) {    ...

  10. [Beta阶段]第八次Scrum Meeting

    Scrum Meeting博客目录 [Beta阶段]第八次Scrum Meeting 基本信息 名称 时间 地点 时长 第八次Scrum Meeting 19/05/14 大运村寝室6楼 25min ...