Web tier & WAF
A WAF filters the requests, web servers terminate them and serve static files, apps behind do the real work.
The CityScript
This is all there is to it. Change it in the editor and the city redraws.
%% W · Web tier & WAF
%% Three tiers with one job each: filter, serve, compute. Static files never reach the app servers.
city 48x32
district edge "Filter" 3,3..13,14
district web "Web tier" 18,3..31,14
district app "App tier" 36,3..46,17
building waf tower in edge "WAF"
floor waf.f "Rules"
room waf.rules proxy "OWASP rules" port=443
room waf.bots proxy "Bot filter" port=443
building nginx-1 factory in web "Web 1"
floor nginx-1.f "nginx"
room nginx-1.nginx proxy "nginx" port=80,443
room nginx-1.static storage "Static files"
building nginx-2 factory in web "Web 2"
floor nginx-2.f "nginx"
room nginx-2.nginx proxy "nginx" port=80,443
room nginx-2.static storage "Static files"
building app-1 factory in app "App 1"
floor app-1.f "Runtime"
room app-1.api service "API" port=8080
room app-1.session cache "Sessions" port=6379
building app-2 factory in app "App 2"
floor app-2.f "Runtime"
room app-2.api service "API" port=8080
room app-2.session cache "Sessions" port=6379
gate users at 0,8 port=443 "Visitors"
link waf.rules -> waf.bots "allowed"
link waf.bots -> nginx-1.nginx "HTTPS" variant=emphasis
link waf.bots -> nginx-2.nginx "HTTPS" variant=emphasis
link nginx-1.nginx -> app-1.api "HTTP" variant=emphasis
link nginx-2.nginx -> app-2.api "HTTP" variant=emphasis
link app-1.api -> app-1.session "session"
link app-2.api -> app-2.session "session"