-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
63 lines (51 loc) · 1.11 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
60
61
62
63
server {
listen 80; #since 80 port is forbid in mac.
server_name 1xue.me;
# 静态资源、项目js、css、图片
location /dist/ {
root /www/drip-front-end;
}
# 静态资源、 公共js、css等
location /public/ {
root /www/drip-front-end;
}
# 上传的图片, 这里和下面可以通过正则表达式合并成一个
location /photos/ {
proxy_pass http://localhost:9090/photos/;
}
location /images/ {
proxy_pass http://localhost:9090/images/;
}
location /api/ {
proxy_set_header x-request-host $host;
proxy_pass http://localhost:9090/api/;
}
# admin
location /admin/ {
root /www/drip-front-end/public;
index admin.html;
}
# index
location / {
root /www/drip-front-end/public/;
}
}
server {
listen 80 default_server;
location /api/ {
proxy_set_header x-request-host $host;
proxy_pass http://localhost:9090/api/;
}
# 静态资源、项目js、css、图片
location /dist/ {
root /www/drip-front-end;
}
# 静态资源、 公共js、css等
location /public/ {
root /www/drip-front-end;
}
location / {
root /www/drip-front-end/public;
index theme.html;
}
}