Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 479 Bytes

README.md

File metadata and controls

18 lines (16 loc) · 479 Bytes

OpenResty 動的リバースプロキシのサンプル

OpenResty/Redis/Luaの組み合わせで、Hostに応じてupstreamを動的に変更するサンプル。

Create upstream config in Redis

% docker-compose exec redis sh
# redis-cli
127.0.0.1:6379> hmset test1.example.com upstream "http://nginx:81"
OK
127.0.0.1:6379> hmset test2.example.com upstream "http://nginx:81"
OK

Add to hosts

127.0.0.1 test1.example.com
127.0.0.1 test2.example.com