首页 > 其他 > 详细

前端nginx配置

时间:2019-12-04 15:39:05      阅读:63      评论:0      收藏:0      [点我收藏+]

主站前端nginx配置说明

一、     主站

1.    具体内容

 技术分享图片

2.    SSL证书配置

433端口部分的配置为ssl证书配置。

其中,ssl_certificate与ssl_certificate_key字段对应证书所在目录与证书名

其他配置字段参考官网

3.    http强制转换为https

server/location中以下内容控制http强制转为https

rewrite ^(.*)$ https://$host$1 permanent

4.    React-Router中history路由处理

server/location中以下内容history路由处理,即,让http://finglodon.com/bx可通过浏览器输入直接访问

注意,http://会跳转到https://,所以也要处理https://finglodon.com/bx的history路由问题,故,433端口的server中也配置这一项

try_files $uri /index.html

二、     保险介绍页

1.    具体内容

 技术分享图片

2.    自动跳转配置

rewrite “/” https://finglodon.com/bx permanent

三、     静态资源服务配置

1.    不可访问目录

nginx默认没有目录浏览权限,需要开启浏览目录权限的话增加autoinedx on,默认是off。我们这里不需要,不加。

前端nginx配置

原文:https://www.cnblogs.com/zs-note/p/11981312.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!