Nginx Memo

Nginx 配置

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;
}
}

NGINX 文件服务器

1
2
3
4
5
6
7
8
9
10
11
server {
listen 8001;
server_name 10.83.152.74; # 自己PC的ip或者服务器的域名
charset utf-8; # 避免中文乱码
root /home/luban/workspace/gluon-park/1211/test_result; # 存放文件的目录
location / {
autoindex on; # 索引
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
}
}

超时时间设置

编辑 /etc/nginx/conf.d/timeout.conf

1
2
3
4
proxy_connect_timeout       600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;