-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx.conf
59 lines (47 loc) · 1.38 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 顶层配置信息管理服务器级别行为
worker_processes 1;
# event指令与事件模型有关,配置处理连接有关信息
events {
worker_connections 1024;
}
# http指令处理http请求
http {
# mime type映射
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
# server 表示一个虚拟主机,一台服务器可配置多个虚拟主机
server {
#listen 80;
listen 443;
ssl on;
ssl_certificate /tmp/vue-shop/server/config/ssl/server.crt;
ssl_certificate_key /tmp/vue-shop/server/config/ssl/server.key;
# 识别的域名
server_name localhost;
# 一个关键设置,与url参数乱码问题有关
charset utf-8;
#access_log logs/host.access.log main;
location / {
root /tmp/vue-shop/dist;
index index.html;
# deny all; 拒绝请求,返回403
allow all;
}
location ~ /api/.+ {
proxy_pass http://127.0.0.1:3000;
}
# 定义各类错误页
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}