{"action":"created","issue":{"url":"https://api.github.com/repos/mholt/caddy/issues/526","labels_url":"https://api.github.com/repos/mholt/caddy/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/526/comments","events_url":"https://api.github.com/repos/mholt/caddy/issues/526/events","html_url":"https://github.com/mholt/caddy/issues/526","id":127982909,"number":526,"title":"Layered request handling","user":{"login":"smcmurray","id":1036479,"avatar_url":"https://avatars.githubusercontent.com/u/1036479?v=3","gravatar_id":"","url":"https://api.github.com/users/smcmurray","html_url":"https://github.com/smcmurray","followers_url":"https://api.github.com/users/smcmurray/followers","following_url":"https://api.github.com/users/smcmurray/following{/other_user}","gists_url":"https://api.github.com/users/smcmurray/gists{/gist_id}","starred_url":"https://api.github.com/users/smcmurray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcmurray/subscriptions","organizations_url":"https://api.github.com/users/smcmurray/orgs","repos_url":"https://api.github.com/users/smcmurray/repos","events_url":"https://api.github.com/users/smcmurray/events{/privacy}","received_events_url":"https://api.github.com/users/smcmurray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-21T17:57:35Z","updated_at":"2016-01-21T21:01:59Z","closed_at":null,"body":"It would be nice to be able to layer request handling such that you could do things like:\r\n\r\n* serve from one directory, and failing that, server from a different directory\r\n* serve from filesystem, then failing that, proxy to app server (or vice versa)."},"comment":{"url":"https://api.github.com/repos/mholt/caddy/issues/comments/173706635","html_url":"https://github.com/mholt/caddy/issues/526#issuecomment-173706635","issue_url":"https://api.github.com/repos/mholt/caddy/issues/526","id":173706635,"user":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T21:01:59Z","updated_at":"2016-01-21T21:01:59Z","body":"Yes, rewrite is good for most of this. The problem with layering the handling is that it can quickly get out of control. Essentially it turns into scripting your own web server, and at that point you might as well just be using Go or JavaScript or something."}}