Caddy: Reverse proxy and static files config

Created on 7 Jun 2020  路  2Comments  路  Source: caddyserver/caddy

THIS MAY BE A NOOB QUESTION

There do is an example config for reverse proxy

https://caddyserver.com/docs/caddyfile/patterns#reverse-proxy

example.com

root * /var/www
reverse_proxy /api/* localhost:5000
file_server

But I need a reverse config:

Serve static files having a path starting with /static/ and proxy requests for everything else

I use the follow config:

example.com

root /static/* /var/www
file_server

reverse_proxy /* localhost:5000

but it seems dosen't work.

question

Most helpful comment

Please, use https://caddy.community/ for questions.

All 2 comments

Please, use https://caddy.community/ for questions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crvv picture crvv  路  3Comments

kilpatty picture kilpatty  路  3Comments

wayneashleyberry picture wayneashleyberry  路  3Comments

treviser picture treviser  路  3Comments

ericmdantas picture ericmdantas  路  3Comments