-
Notifications
You must be signed in to change notification settings - Fork 14
/
nginx.conf
90 lines (73 loc) · 2.6 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
server
{
listen 80;
server_name xxxxx.com;# 改成你的后台域名
index index.html index.htm default.htm default.html;
root /www/wwwroot/xxxxx.com/dist; #改成你的项目路径
#SSL-START SSL相关配置
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页相关配置
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
# HTTP反向代理相关配置开始 >>>
location /api/ {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://127.0.0.1:8888/;
proxy_set_header Host 127.0.0.1:$server_port;
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;
add_header X-Cache $upstream_cache_status;
proxy_set_header X-Host $host:$server_port;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 30s;
proxy_read_timeout 86400s;
proxy_send_timeout 30s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
try_files $uri $uri/ /index.html index.html;
}
# HTTP反向代理相关配置结束 <<<
access_log /www/wwwlogs/bee-admin.log;
error_log /www/wwwlogs/bee-admin.error.log;
}
server
{
listen 80;
server_name xxxxx.com;# 改成你的api域名
index index.html index.htm default.htm default.html;
root /www/wwwroot/xxxxx.com/dist; #改成你的项目路径
#SSL-START SSL相关配置
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页相关配置
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
# HTTP反向代理相关配置开始 >>>
location / {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://127.0.0.1:18083/;
#proxy_pass http://127.0.0.1:18888/api;
proxy_set_header Host 127.0.0.1:$server_port;
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;
add_header X-Cache $upstream_cache_status;
proxy_set_header X-Host $host:$server_port;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 30s;
proxy_read_timeout 86400s;
proxy_send_timeout 30s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
access_log /www/wwwlogs/bee-api.log;
error_log /www/wwwlogs/bee-api.error.log;
}