stream { upstream redis { server 127.0.0.1:6379 max_fails=3 fail_timeout=30s; #*redis-addres*替换为真实地址 } server { # 对外暴露端口号 listen 2101; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass redis; } }