caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
56.45k stars 3.96k forks source link

[Grafana] Reverse proxy not working with Caddy2 but Caddy1 #3377

Closed mrplug closed 4 years ago

mrplug commented 4 years ago

Hey!

I observed some very strange behavior: Reverse proxy with Grafana is working like a charm, when using Caddy1. Both servers are running a docker container.

As soon as i switch to Caddy2 i only see a blank page.

Caddyfile1 grafana.domain.net { proxy / http://grafana:3000 }

Caddyfile2 grafana.domain.net { reverse_proxy / http://grafana:3000 }

I already checked the migration documentation and i can't see any specific why this should not work. Anybody with a similar behavior when migrating from v1 to v2?

kayg04 commented 4 years ago

Try:

 grafana.domain.net { reverse_proxy http://grafana:3000 }

With your caddyfile2, what's happening is requests to only / are matched and the other subpaths are getting ignored since they are not being handled. By default, reverse_proxy without a matcher works for all requests.

francislavoie commented 4 years ago

Hi! Thanks for trying Caddy! Looks like you already got the help you needed.

For next time, please ask your usage questions on the Caddy community forums. We prefer to keep the GitHub issue board for bugs and feature requests. Don't forget to fill out the thread template so we can help you!

mholt commented 4 years ago

Yep, and our upgrade guide explains this: https://caddyserver.com/docs/v2-upgrade#primary-changes

Thanks for the answer @kayg04 !