Skip to content

Instantly share code, notes, and snippets.

@coreybutler
Created August 20, 2012 14:38
Show Gist options
  • Save coreybutler/3404755 to your computer and use it in GitHub Desktop.
Save coreybutler/3404755 to your computer and use it in GitHub Desktop.
Example cache.json used for NGNX.web.Proxy
{
"remote": null,
"cache": [
{
"hostname": "localhost",
"port": 83,
"alias": [
"127.0.0.1"
],
"target": [
"localhost:8383"
],
"rules": {
"GET": [
{
"/api/v1/(.*)$": "api.cfm?v=1&fn=$1"
},
{
"/api/v2/(.*)$": "api.cfm?v=2&fn=$1"
}
],
"ALL": [
{
"/api/v3/(.*)$": "api.cfm?v=3&fn=$1"
},
{
"(.*)/test": "api.cfm?path=$1"
}
]
}
},
{
"hostname": "localhost",
"port": 87,
"alias": [
"127.0.0.1",
"ecor2.biz",
"ecor3.biz"
],
"target": [
"localhost:8383"
],
"rules": {
"GET": [
{
"/(.*)/$": "/?x=$1"
},
{
"/api/v1/(.*)$": "api.cfm?v=1&fn=$1"
},
{
"/api/v2/(.*)$": "api.cfm?v=2&fn=$1"
}
],
"ALL": [
{
"/api/v3/(.*)$": "api.cfm?v=3&fn=$1"
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment