| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
code.org => (DNS managed by route 53) => 54.192.37.35 (...etc...)
(dig code.org => 54.192.37.35, whois 54.192.37.35 output shows it's an Amazon-owned IP, AMAZO-CF2 == CloudFront.)
Other "front door" domain names to code.org served by our main web application (pegasus & dashboard):
All of the above domain names are configured in Route53 to resolve to the IP addresses of CloudFront Distributions.
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).
CloudFront => Elastic Load Balancing [ELB]
ELB => => multiple Frontend servers (Elastic Compute Cloud [EC2] with Auto Scaling)
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 HTTPCache class 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.
NGiNX (port 808{0,1}) => Unix socket/s (/run/unicorn/{dashboard,pegasus}.sock)
Unicorn (UNIX socket/s) => Ruby application Rack server/s
Rack server definition files:
Web-application based on sinatra routing framework, with custom template and view-rendering layer.
Standard Rails application.
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.
| Back | FazBrowse Home | New Git URL |