[Nginx] Configuration for SPA
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的更多相关文章
- Nginx - Configuration File Syntax
Configuration Directives The Nginx configuration file can be described as a list of directives organ ...
- nginx configuration
Now that you know how to manage the service itself, you should take a few minutes to familiarize you ...
- Nginx Configuration 免费HTTPS加密证书
Linux就该这么学 2018-05-11 实验环境:CentOS Linux release 7.3.1611 (Core) 内核版本:Linux version 3.10.0-514.el7.x8 ...
- kubernetes 的ingress controller 的nginx configuration配置参数
下列列举一些参数其中常用的大家可根据实际情况自行添加(影响全局) kubectl edit cm nginx-configuration -n ingress-nginx 配置文件cm的定义: htt ...
- 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- ...
- Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解
转载:http://freeloda.blog.51cto.com/2033581/1288553 大纲 一.前言 二.环境准备 三.安装与配置Nginx 四.Nginx之反向代理 五.Nginx之负 ...
- nginx启动、关闭、重启
1.启动 [root@localhost local]# nginx/sbin/nginx #启动 [root@localhost local]# nginx/sbin/nginx -t #检查配置文 ...
- Linux下安装nginx
一直会使用nginx,也学习了好多nginx知识.也在本地安装过nginx,这次是第一次在正式的环境安装nginx,把这些记录下来总结经验. 一.安装环境 操作系统:CentOS release 6. ...
- 如何正确配置Nginx+PHP
对很多人而言,配置Nginx+PHP无外乎就是搜索一篇教程,然后拷贝粘贴.听上去似乎也没什么问题,可惜实际上网络上很多资料本身年久失修,漏洞百出,如果大家不求甚解,一味的拷贝粘贴,早晚有一天会为此付出 ...
随机推荐
- VIM 键盘符号
:h key-notation //查询键盘符号说明<>> 等于shift + > % 是跳到对应的括号 x 是删除当前字符,即右括号 '' 是跳回左括号 x 删除左括号
- php三种常用的加密解密算法
方法一: /** * @param $string 要加密/解密的字符串 * @param string $operation 类型,ENCODE 加密:DECODE 解密 * @param stri ...
- hdu3966 树链剖分点权模板+线段树区间更新/树状数组区间更新单点查询
点权树的模板题,另外发现树状数组也是可以区间更新的.. 注意在对链进行操作时方向不要搞错 线段树版本 #include<bits/stdc++.h> using namespace std ...
- ubuntu基本用法
• Linux上vim编辑器缩进的设置 • 从零开始UNIX环境高级编程(0):Linux下运行第一个程序
- Django的auto_now=True没有自动更新
auto_now=True自动更新,有一个条件,就是要通过django的model层. 如create或是save方法. 如果是filter之后update方法,则直接调用的是sql,不会通过mode ...
- python下载文件的方法
前一段时间是爬文字,最近准备爬图片 找到了两种保存文件的方法 一种是用urllib.urlretrieve方法 #-*- coding: utf-8 -*- import urllib def cal ...
- [转]oracle10客户端PL/SQL Developer如何连接远程服务器上的oracle数据库
时间:2013年8月21日 前提条件:假设你已经安装好了oracle和PL/SQL Developer,知道远程服务器的IP和数据库端口,知道远程服务器上的oracle数据库名和密码 如何用PL/SQ ...
- memcache的简单使用示例
在实际应用中我们会缓存从数据库中查出来的结果集,以md5($sql)为$key,结果集为值. 以只是在php简单应用代码: <?php //建立memcache链接 $memcache = ne ...
- 修改idea自动生成在C盘的文件路径,以免电脑越用越卡
1.看图一步一步来 2.将原来该位置的文件剪切到你指定的路径下 3.启动idea ,选择以前的配置即可
- mysql5.7一键安装脚本
0. 概述 最近鼓捣出了一个mysql安装脚本,将该脚本,mysql的my.cnf文件,mysql的安装包这三个文件放在同一个目录下面,执行sh mysql-auto-install.sh就可以完成m ...