server {
listen 0.0.0.0:;
listen [::]:;
default_type application/octet-stream; gzip on;
gzip_comp_level ;
gzip_vary on;
gzip_min_length ;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 8k;
client_max_body_size 256M; root /usr/share/nginx/html; location / {
try_files $uri $uri/ /index.html =;
}
}

The highlighted part is important, without this, if you hint the page url:

http://localhost:8080/orders/1

It will show 404 page, because it will be regareded as a server request.

With this line of code, it will return index.html, then Frontend framework can handle with the router.

[Nginx] Configuration for SPA的更多相关文章

  1. Nginx - Configuration File Syntax

    Configuration Directives The Nginx configuration file can be described as a list of directives organ ...

  2. nginx configuration

    Now that you know how to manage the service itself, you should take a few minutes to familiarize you ...

  3. Nginx Configuration 免费HTTPS加密证书

    Linux就该这么学 2018-05-11 实验环境:CentOS Linux release 7.3.1611 (Core) 内核版本:Linux version 3.10.0-514.el7.x8 ...

  4. kubernetes 的ingress controller 的nginx configuration配置参数

    下列列举一些参数其中常用的大家可根据实际情况自行添加(影响全局) kubectl edit cm nginx-configuration -n ingress-nginx 配置文件cm的定义: htt ...

  5. Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks

    原文链接:http://www.if-not-true-then-false.com/2011/nginx-and-php-fpm-configuration-and-optimizing-tips- ...

  6. Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解

    转载:http://freeloda.blog.51cto.com/2033581/1288553 大纲 一.前言 二.环境准备 三.安装与配置Nginx 四.Nginx之反向代理 五.Nginx之负 ...

  7. nginx启动、关闭、重启

    1.启动 [root@localhost local]# nginx/sbin/nginx #启动 [root@localhost local]# nginx/sbin/nginx -t #检查配置文 ...

  8. Linux下安装nginx

    一直会使用nginx,也学习了好多nginx知识.也在本地安装过nginx,这次是第一次在正式的环境安装nginx,把这些记录下来总结经验. 一.安装环境 操作系统:CentOS release 6. ...

  9. 如何正确配置Nginx+PHP

    对很多人而言,配置Nginx+PHP无外乎就是搜索一篇教程,然后拷贝粘贴.听上去似乎也没什么问题,可惜实际上网络上很多资料本身年久失修,漏洞百出,如果大家不求甚解,一味的拷贝粘贴,早晚有一天会为此付出 ...

随机推荐

  1. 【ES】学习8-聚合1

    参考资料: https://elasticsearch.cn/book/elasticsearch_definitive_guide_2.x/_combining_the_two.html 特定概念: ...

  2. 【linux】centos6.9安装gearman

    1.确认yum源没问题,如果有问题,参照这里更换 2. yum install -y boost-devel gperf libevent-devel libuuid-devel yum instal ...

  3. 关于引用外部类要用static 的问题

    一.直接用 static 引用 import static net.mindview.util.Print.*; //net...为引用的类,此方法在程序加载时就已实例化 二. 也可以手动在需要时实例 ...

  4. Laravel collection 报错 join(): Invalid arguments passed

    混淆了 array 与 collection,join 并不支持 collection. array 与 collection 不同的 join 实现 collect([1, 2, 3, 4, 5]) ...

  5. Windows安装使用Openssl

    1.什么是openssl? 2.下载安装 三方下载地址 备用64位和32位下载地址 选择32位或者64位合适的版本下载,例如Win64OpenSSL_Light-1_0_2h.exe: 设置环境变量, ...

  6. 步步为营-69-Razor基础

    作用:进一步将HTML代码和C#代码进行解耦 1.1 引用程序集(RazorEngine.dll,System.Web.Razor.dll) 1.1.1 可以从http://razorengine.c ...

  7. 步步为营-58-SQLite的使用

    说明:文档型关系数据库,多用于移动端 1.1 添加引用 ` 1.1.1 System.Data.SQLite.xml 1.1.2 System.Data.SQLite.dll 1.2 连接字符串的设置 ...

  8. 步步为营-42-通过DataAdapter实现增删查改

    说明:通过DataAdapter或者dataset连接数据库,实现对数据增删改查操作. 以前写过一篇步步为营-23-通过GridView实现增删改 1:SqlDataAdapter  DataTabl ...

  9. 去掉li列表前面的空格

    如果用li做列表的话,li前面的空格其实是li的默认样式.因为li位于ul里面,所以,有空格代表了ul肯定有padding值. ul { margin: 0px; padding: 0px; }

  10. Python 打印当前文件相对路径和绝对路径

    一.打印相对路径 print(__file__) 二.打印绝对路径 import os print(os.path.abspath(__file__)) 三.打印文件名 import os print ...