You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other "front door" domain names to code.org served by our main web application (pegasus & dashboard):
studio.code.org
advocacy.code.org
hourofcode.com
codeprojects.org
All of the above domain names are configured in Route53 to resolve to the IP addresses of CloudFront Distributions.
CDN / load-balancer
Each CloudFront Distribution has multiple Origins configured. The most important Origin typically is a DNS name that resolves to an AWS Application Load Balancer (ELBv2).
Varnish Cache (port 80) => port 8080 (dashboard) or port 8081 (pegasus) (depending on Host header: code.org => pegasus, studio.code.org => dashboard)
This ERB logic generates VCL that decides whether to route an HTTP request to dashboard or pegasus.
Note that the Ruby HTTPCacheclass generates a hash that is used to generate CloudFront Behaviors, Varnish VCL, and Rack middleware logic that all implement the same HTTP routing/cache rules for different types of environments.
We have several Rack middlewarespec modules that are inserted into both Pegasus (via config.ru) and Dashboard (via application.rb), and provide 'shared' functionality to both web-applications. Some of these middleware apps are their own self-contained Sinatra apps (e.g., FilesApi) that handle their defined routesexample when inserted into the middleware 'stack' for each web-app.