-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathnginx.conf.no_office.template
231 lines (207 loc) · 11.4 KB
/
nginx.conf.no_office.template
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# nginx : /usr/local/Cellar/nginx/nginx-1.17.8/objs/nginx
# nginx.conf : /usr/local/nginx/conf/nginx.conf
#user nobody;
worker_processes 2;
events {
worker_connections 1024;
}
#设定http服务器,利用它的反向代理功能提供负载均衡支持
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#设定mime类型,类型由mime.type文件定义
include mime.types;
#设置文件使用的默认的MIME-type
default_type application/octet-stream;
#sendfile指令指定 nginx 是否调用sendfile 函数(zero copy 方式)来输出文件,对于普通应用,必须设为on。如果用来进行下载等应用磁盘IO重负载应用,可设置为off,以平衡磁盘与网络IO处理速度,降低系统uptime
sendfile on;
tcp_nopush on;
#keepalive超时时间。
keepalive_timeout 65;
#gzip on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
map $http_host $this_host {
"" $host;
default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
default $http_x_forwarded_proto;
"" $scheme;
}
map $http_x_forwarded_host $the_host {
default $http_x_forwarded_host;
"" $this_host;
}
server {
listen 8089;
server_name localhost;
location = / {
proxy_pass http://jmalcloud:8088/articles;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /api {
proxy_pass http://jmalcloud:8088;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /articles/articles {
proxy_pass http://jmalcloud:8088/articles;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /articles {
proxy_pass http://jmalcloud:8088/articles;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location / {
proxy_pass http://jmalcloud:8088/articles/;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
}
###jmal-cloud-vie vue.js 前端配置
server {
listen 80;
server_name localhost;
root /var/www/public;
client_max_body_size 50m;
client_body_buffer_size 512k;
location / {
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location = /blog {
proxy_pass http://jmalcloud:8088/articles;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location = /blog/ {
proxy_pass http://jmalcloud:8088/articles;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /blog/api/ {
proxy_pass http://jmalcloud:8088/;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /blog/articles {
proxy_pass http://jmalcloud:8088/articles/;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /blog/ {
proxy_pass http://jmalcloud:8088/articles/;
proxy_set_header Host $proxy_host;
proxy_set_header X-real-ip $remote_addr;
}
location /api/ {
proxy_pass http://jmalcloud:8088/;
proxy_http_version 1.1;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host/file;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /webDAV/ {
proxy_pass http://jmalcloud:8088/webDAV/;
proxy_http_version 1.1;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host/file;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location /file/ {
proxy_pass http://jmalcloud:8088/file/;
proxy_http_version 1.1;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host/file;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /mq {
proxy_pass http://jmalcloud:8088/mq/;
#websocket额外配置开始
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 60s;#l连接超时时间,不能设置太长会浪费连接资源
proxy_read_timeout 500s;#读超时时间
proxy_send_timeout 500s;#写超时时间
#websocket额外配置结束
}
location /drawio/webapp/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host//drawio/webapp;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /pdf.js/ {
proxy_pass http://localhost:8081/;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host//pdf.js;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
include servers/*;
}