多级缓存-OpenResty tomcat集群负载均衡

#user  nobody;
worker_processes  1;
error_log  logs/error.log;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
 
    #nginx的业务集群,nginx本地缓存、redis缓存、tomcat查询
    upstream nginx-cluster{
        hash $request_uri;
        server 192.168.8.118:8081;
        server 192.168.8.118:8082;
    }
    
    server {
        listen       80;
        server_name  localhost;
        
        
        location /item {
            proxy_pass http://nginx-cluster;
        }
 
        location / {
            root   html;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

 

原文地址:https://www.cnblogs.com/linjiqin/p/15434987.html