Serve files in root before passing to proxy

This seem to work:-

localhost:4000
root ./public
rewrite {
    if {path} is /
    to /proxy/{uri}
}
rewrite {
    to {path} /proxy/{uri}
}

proxy /proxy localhost:8080 {
    without /proxy
}

Based on this issue - https://github.com/mholt/caddy/issues/695

Although this seem to break my websocket directive.