auth0 / cxn

cXn: extensible open-source CDN
MIT License
179 stars 19 forks source link

Is there a way to configure cxn for dedicated server instead of S3? #3

Open mdtanrikulu opened 8 years ago

mdtanrikulu commented 8 years ago

I have my own dedicated server and I want to use that server as storage instead of S3. How can I configure or modify it ?

jfromaniello commented 8 years ago

not yet but I will be a nice to have.. I envision a configuration like this:

{
  "cxn": {
    "purgers": {
      "localhost": "127.0.0.1",
      "host-machine": "192.168.10.1"
    },
    "nodes": {
      "vagrant": "192.168.10.200"
    },
    "domains":     [
      {
        "id":            "global",
        "domain":        "cdn.mycompany.com",
        "backend":       "assets.mycompany.com",
        "ssl":           false
      }
    ]
  }
}

notice backend instead of bucket

We will need to change the template for varnish here:

https://github.com/auth0/cxn/blob/master/templates/default/varnish/varnish.vcl.erb#L5-L40

mdtanrikulu commented 8 years ago

So, we'll modify here as below, right?

.host = "<%= config.backend %>";

We will also modify host configuration of fallbacks . (optional)

and could you tell me, this variable represents what exactly?

node['cxn']['siblings'][node['hostname']]
jfromaniello commented 8 years ago

Yes and yes

siblings is an optional setting, it allows you to have one node going to another node, instead to the backend to reduce latency on assets that are not cached yet (Cache: MISS)