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. mysql的基本演示

    数据库需要配置 cmd打开doc窗口 net start mysql:启动数据库 net stop mysql :停止数据库 表的定义:列  行  主键

  2. 2017-2018-2 20155309 南皓芯 Exp5 MSF基础应用

    实践内容 本实践目标是掌握metasploit的基本应用方式,重点常用的三种攻击方式的思路.具体需要完成: 1.1一个主动攻击实践,如ms08_067; 1.2 一个针对浏览器的攻击,如ms11_05 ...

  3. DDD领域模型数据访问之对象(十一)

    在工程DDD.Domain中文件夹ModelPermission新建类:BAS_Object public partial class BAS_Obejct:AggreateRoot { //仓储接口 ...

  4. 快速构建ceph可视化监控系统

    https://my.oschina.net/colben/blog/1844602 https://my.oschina.net/u/3626804/blog/1859613

  5. 开始写博客,学习Linq(5)

    开始写代码了,我会把自己的代码粘贴在这里,好不容易可以实践了,可是不能偷懒的. string[] words = { "hello", "wonderful", ...

  6. AndroidStudio将html5打包成apk

    我想将html5的动画效果打包成手机app,以方便传播.而在android开发的组件中就直接由webview可以访问网页,另外在android工程中,assets文件夹下的内容是不会在被编译的,因此可 ...

  7. C#连接oracle连接字符串

    /// <summary> /// Oracle 的数据库连接字符串. /// </summary> private const String connString = @&q ...

  8. BZOJ4972 八月月赛 Problem B 小Q的方格纸 二维前缀和

    欢迎访问~原文出处——博客园-zhouzhendong 去博客园看该题解 题目传送门 - BZOJ4972 八月月赛Problem B 题目概括 一个矩阵,一坨询问,问矩阵中一个特定方向的等腰直角三角 ...

  9. (转)python中调用R语言通过rpy2 进行交互安装配置详解

    python中调用R语言通过rpy2 进行交互安装配置详解(R_USER.R_HOME配置) 2018年11月08日 10:00:11 luqin_ 阅读数:753   python中调用R语言通过r ...

  10. Cpu 常见系列以及型号

    Intel旗下 赛扬(Celeron)——桌面低端 奔腾(Pentium)—— 桌面中端 酷睿 (Core)——桌面高端 至强(Xeon)——服务器中端 安腾(Itanium)——服务器高端 凌动(A ...