[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无外乎就是搜索一篇教程,然后拷贝粘贴.听上去似乎也没什么问题,可惜实际上网络上很多资料本身年久失修,漏洞百出,如果大家不求甚解,一味的拷贝粘贴,早晚有一天会为此付出 ...
随机推荐
- docker 运行Django项目
一.概述 已经写好了一个Django项目,需要将这个项目用docker封装一个镜像,使用k8s发布! 在封装并运行的过程中,发现了很多问题,这里会一一介绍! 二.时区问题 采用的是镜像是 ubuntu ...
- DOM树示意图
- HDU 3336 输出包括从1到len长 字符串前缀的总个数(+DP)
Sample Input14abab Sample Output6输出包括从1到len长 字符串前缀的总个数abab:包括2个a,2个ab,1个aba,1个abab # include <cst ...
- -webkit-line-clamp超出省略
以前只用过超出一行显示省略号 有时候会碰到只显示两到三行,超出省略 -webkit-line-clamp属性就能解决这个问题 text-overflow: -o-ellipsis-lastline; ...
- Codeforces 1114F Please, another Queries on Array? 线段树
Please, another Queries on Array? 利用欧拉函数的计算方法, 用线段树搞一搞就好啦. #include<bits/stdc++.h> #define LL ...
- Mysql 双主架构配置从复制
引用自:https://blog.csdn.net/deeplearnings/article/details/78398526 https://www.cnblogs.com/ygqygq2/p/6 ...
- Ajax提交form表单内容和文件(jQuery.form.js)
jQuery官网是这样介绍form.js A simple way to AJAX-ify any form on your page; with file upload and progress s ...
- Linux成长之路
Linux命令格式: 命令 选项 参数command [-options] [parameter1] ···· 常用命令: tree 以目录树的方式显示: tree / 以目录树方式显示根目录结构 ...
- Android应用开发-数据存储和界面展现(二)
SQLite数据库 // 自定义类MyOpenHelper继承自SQLiteOpenHelper MyOpenHelper oh = new MyOpenHelper(getContext(), &q ...
- 项目冲刺Forth
Forth Sprint 1.各个成员今日完成的任务 蔡振翼:修改部分博客 谢孟轩:续借功能和编辑资料功能的实现 林凯:初步实现登录功能 肖志豪:帮助其他人解决一些问题 吴文清:编写完善管理员个人界面 ...