Skip to content

Commit fede0fb

Browse files
author
Zhicheng WANG
committed
docs: 增加如何部署到本地环境的指南
1 parent a8b008d commit fede0fb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

guides/deploy-to-local.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Deploy to local
2+
3+
# 部署到本地环境
4+
5+
有些企业内部的防火墙比较严格,如果无法打开 <https://material.angular.cn>,你可以在企业内部进行私有化部署。步骤如下:
6+
7+
本文档的预编译版本位于 [Github](https://github.com/ng-docs/material-cn-prebuilt) 上,如果你想进行私有化部署,请把它 Clone 下来,在 nginx 等服务器上按照静态网站的形式做部署即可,除此之外不需要任何服务端环境。
8+
9+
以 Nginx 为例,你需要在 nginx 上做如下改动:
10+
11+
```
12+
server {
13+
root /path/to/material-cn-prebuilt/;
14+
location / {
15+
try_files $uri $uri.html $uri/ /index.html;
16+
}
17+
}
18+
```
19+
20+
注意其中的 `$uri.html`,这是本文档相对于常规 Angular 应用的主要差别,因为本文档进行了预先渲染(Prerender),这项工作可以让你在不需要 Node 服务器的情况下获得等同于服务端渲染的体验改善。

0 commit comments

Comments
 (0)