GithubHelp home page GithubHelp logo

metaworx / cucumber.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cucumber-ltd/cucumber.io

0.0 2.0 0.0 319 KB

Web server for https://cucumber.io

Dockerfile 7.01% Ruby 73.13% Makefile 4.02% Shell 15.85%

cucumber.io's Introduction

CircleCI

cucumber.io proxy server


This repo contains the source for an nginx web server that runs at https://cucumber.io to handle our incoming traffic. Its job is to forward on URLs to different web servers that serve the content for different parts of our website.

The routing configuration is in nginx/server.conf

It's automatically deployed to Heroku when you push to master if tests pass.

How the whole thing works

All requests to https://cucumber.io are first managed by Cloudflare.

Cloudflare's DNS servers send requests to this nginx app, running at https://cucumber-io-proxy.herokuapp.com

This nginx app looks at the path in the request and, according to its rules, makes another request to the server that's actually responsible for delivering content for that path.

For example, traffic to /docs is handled by our hugo app running with Netlify at https://cucumber.netlify.com whereas traffic to / or /events is handled by Squarespace running at https://cucumber-website.squarespace.com For our generated files like our sitemap.xml or rss feed, we have another repo that builds nightly, sanitizes the urls to only be cucumber.io, and then uploads the new copies to Amazon's S3 for use. The nginx server's config points to those files for routing.

+-------------+        +----------------
|             |        |               |
|             |        |  cucumber.io  |         /            +----->   cucumber-website.squarespace.com
| Cloudflare  +-------->  nginx proxy  +------>  /blog        +----->   cucumber.ghost.io
|             |        |               |         /training    +----->   cucumber-website.squarespace.com
|             |        |               |         /docs        +----->   cucumber.netlify.com
|             |        |               |         /sitemap.xml +----->   cucumber-io-generated-files.s3-eu-west-1.amazonaws.com
+-------------+        +---------------+

Why did you make it so complicated?!

Well. We wanted to keep everything on the same domain, but have choices about the best services to use for the content. You can get these features with Cloudflare's enterprise plan, but that was beyond our budget.

Testing

Local

make test_local

Spins up a local docker container on port 9001, runs rspec against it, and stops the container. If you'd like it to install gems for you too, run: make local_test_setup

Local against the live deployment

BASE_URL=https://cucumber.io make rspec

Installs gems and runs rspec against the live site

CircleCI

During builds CircleCI will install nginx locally, and run rspec against that.

cucumber.io's People

Contributors

aslakhellesoy avatar dependabot[bot] avatar jbpros avatar mattwynne avatar mxygem avatar romaingweb avatar tooky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.