Nginx的配置:
动静分离,反向代理,负载均衡
官网:http://nginx.org/en/docs/http/load_balancing.html
Nginx.conf include使用
新建 .conf文件
server {
#配置HTTP服务器监听的端口号,这里默认写为8880
listen 8001;
server_name localhost;
location / {
root E:/work/ManagerToDB_0.2;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
#下面配置Tomcat或WAS服务器的地址,服务程序会自动进行代理转发
location /data{
proxy_pass http://10.10.10.**:8001/data/;
}
}
而在nginx.conf文件中只要写入
include 文件目录/*.conf;