Nginx Memo

一份反向代理的极简配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
upstream formula {
# change this configure to conrresponding ports
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
server 127.0.0.1:8004;
}
server {
listen 8000;
# change this config to the corresponding path
root /home/gys/formula-recog/server;
location / {
# 与第一行中的 upstream 的名字一致
proxy_pass http://formula;
proxy_connect_timeout 5s;
}
}