forked from clickvisual/clickvisual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: kl7sn <[email protected]>
- Loading branch information
Showing
5 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 自定义域名配置 | ||
|
||
配置自定义域名为 xxx.com | ||
|
||
1. 调整服务配置 | ||
|
||
``` | ||
[app] | ||
rootURL = "http://xxx.com" | ||
``` | ||
|
||
2. NGINX 配置调整,可以开启 gzip | ||
```bash | ||
server { | ||
listen 80; | ||
server_name xxx.com; | ||
|
||
access_log /Users/duminxiang/nginx/xxx.com.access.log; | ||
error_log /Users/duminxiang/nginx/xxx.com.error.log; | ||
|
||
# 开启gzip | ||
gzip on; | ||
|
||
# 启用gzip压缩的最小文件,小于设置值的文件将不会压缩 | ||
gzip_min_length 1k; | ||
|
||
# gzip 压缩级别,1-9,数字越大压缩的越好,也越占用CPU时间,后面会有详细说明 | ||
gzip_comp_level 1; | ||
|
||
# 进行压缩的文件类型。javascript有多种形式。其中的值可以在 mime.types 文件中找到。 | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml; | ||
|
||
# 是否在http header中添加Vary: Accept-Encoding,建议开启 | ||
gzip_vary on; | ||
|
||
# 禁用IE 6 gzip | ||
gzip_disable "MSIE [1-6]\."; | ||
|
||
# 设置压缩所需要的缓冲区大小 | ||
gzip_buffers 32 4k; | ||
|
||
# 设置gzip压缩针对的HTTP协议版本,没做负载的可以不用 | ||
# gzip_http_version 1.0; | ||
|
||
location / { | ||
proxy_pass http://127.0.0.1:9001; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Custom Domain | ||
|
||
Configure the custom domain name as xxx.com | ||
|
||
1. Adjust the service configuration | ||
|
||
``` | ||
[app] | ||
rootURL = "http://xxx.com" | ||
``` | ||
|
||
2. NGINX configuration adjustment, gzip can be enabled | ||
```bash | ||
server { | ||
listen 80; | ||
server_name xxx.com; | ||
|
||
access_log /Users/duminxiang/nginx/xxx.com.access.log; | ||
error_log /Users/duminxiang/nginx/xxx.com.error.log; | ||
|
||
gzip on; | ||
gzip_min_length 1k; | ||
gzip_comp_level 1; | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml; | ||
gzip_vary on; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_buffers 32 4k; | ||
|
||
location / { | ||
proxy_pass http://127.0.0.1:9001; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
} | ||
} | ||
``` | ||
|
Binary file not shown.