{"id":15046731,"url":"https://github.com/auth0/cxn","last_synced_at":"2025-08-16T08:23:20.589Z","repository":{"id":33184775,"uuid":"36826557","full_name":"auth0/cxn","owner":"auth0","description":"cXn: extensible open-source CDN","archived":false,"fork":false,"pushed_at":"2018-10-20T14:57:06.000Z","size":38,"stargazers_count":180,"open_issues_count":5,"forks_count":19,"subscribers_count":115,"default_branch":"master","last_synced_at":"2025-04-06T03:51:02.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auth0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-03T19:46:53.000Z","updated_at":"2024-10-29T09:11:50.000Z","dependencies_parsed_at":"2022-08-17T21:45:26.962Z","dependency_job_id":null,"html_url":"https://github.com/auth0/cxn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/auth0/cxn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fcxn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fcxn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fcxn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fcxn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0","download_url":"https://codeload.github.com/auth0/cxn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0%2Fcxn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270684893,"owners_count":24627896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:53:30.939Z","updated_at":"2025-08-16T08:23:20.562Z","avatar_url":"https://github.com/auth0.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](http://cdn.auth0.com/img/banner-cxn.png)\n\nThis is an opensource cookbook to configure the nodes of cXn.\n\nWhat you need to know:\n\n-  The architecture is *nginx (ssl/app)* -\u003e *varnish (cache)* -\u003e *s3 (storage)*.\n-  The project uses [Chef](https://www.chef.io) to configure the nodes of the CDN.\n-  The nodes use Ubuntu and you are supposed to provision them manually (for now).\n-  The Route53 configuration is done manually (for now).\n\n## Setup\n\nThe configuration of the CDN fits in a JSON format as follows and is stored in \"environments/\":\n\n```json\n{\n  \"nodes\": {\n    \"cdn-example-node-1\": \"54.54.54.54\",\n    \"cdn-example-node-2\": \"54.54.54.54\"\n  },\n  \"purgers\": {\n    \"my-ci-server-1\":   \"54.54.54.54\",\n    \"some-other-thing\": \"54.54.54.54\"\n  },\n  \"newrelic\": \"my-new-relic-token\",\n  \"varnish\": {\n    \"storage_size\": \"4g\"\n  },\n  \"domains\": [\n    {\n      \"id\":            \"global\",\n      \"domain\":        \"cdn.mycompany.com\",\n      \"bucket\":        \"my-s3-bucket\",\n      \"bucket_region\": \"us-east-1\",\n      \"ssl\":           true\n    }\n  ]\n}\n```\n\n-  **nodes** (required): is a hash of the nodes on the CDN. The key is the hostname and the value is the public IP Address.\n-  **purgers** (required): is a hash of nodes allowed to purge the CDN from outside. The key of the hash is not used anywhere and the value is the IP Address.\n-  **newrelic** (optional): is the [newrelic](http://newrelic.com) token. If set the Newrelic agent will be installed and configured on every machine.\n-  **domains** (required): is a list of the domains handled by the CDN. Each domain has the following attributes:\n    -  **id**: friendly name for the domain\n    -  **domain**: the domain for the CDN.\n    -  **bucket**: the S3 backend of the CDN.\n    -  **bucket_region**: the region on the S3 bucket.\n    -  **ssl**: enable/disable https.\n\n## Testing\n\nYou can use vagrant to test things locally:\n\n```\nvagrant up\n```\n\nIn this case the configuration payload is defined inside the Vagrant.pp file.\n\n## Provision\n\nCreate nodes in different geographical regions of AWS or any other service provider with Ubuntu.\n\nPrepare the node with `./prepare-node` before deploying.\n\n## Deploy\n\nMake sure you have [Chef-DK](https://downloads.getchef.com/chef-dk/) installed.\n\nInstall the cookbooks locally:\n\n~~~\nberks install\n~~~\n\nCreate a `environments/production.json` file and run the `./deploy` command.\n\nYou will need to have ssh access to the nodes of the CDN you are going to configure.\n\n## Purging the CDN\n\nPurging of the CDN works by doing a DELETE request:\n\n```\ncurl -XDELETE https://mycdn.com/some/assets\n# these urls will get purged in this case:\n#  https://mycdn.com/some/assets/foo.js\n#  https://mycdn.com/some/assets/bar.js\n#  https://mycdn.com/some/assets/bar/baz.js\n```\n\nIt will automatically purge on the node being hit and it will propagate back to every other node in the CDN.\n\nThis purge request is not authenticated but every node keeps a list of allowed nodes (purgers + nodes).\n\n## DNS\n\nYou can start with Route53 Latency based DNS. This reduce latency for your users by serving their requests from the Amazon EC2 region for which network latency is lowest.\n\nAWS might not have enough regions for you. Auth0 CDN for instance use a combination of **Geolocation Routing** + **Lantency Based**.\n\nThe first level of DNS (cdn.auth0.com) uses GeoLocation and it has a default CNAME pointing to a Latency based record (cdn-global.auth0.com).\n\nThis allow us to point specific countries to other (non-AWS) VPS providers.\n\n## TODO\n\nWe plan to build an opensource [Terraform](https://www.terraform.io/) project to automatically create the EC2 instances and the Route53 configuration.\n\n## Issue Reporting\n\nIf you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.\n\n## Author\n\n[Auth0](https://auth0.com/)\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fcxn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0%2Fcxn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0%2Fcxn/lists"}