Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: add tail_proxy_url option to query_frontend_config section #2879

Merged
merged 2 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/sources/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ The query_frontend_config configures the Loki query-frontend.
# Set to < 0 to enable on all queries.
# CLI flag: -frontend.log-queries-longer-than
[log_queries_longer_than: <duration> | default = 0s]

# URL of querier for tail proxy.
# CLI flag: -frontend.tail-proxy-url
[tail_proxy_url: <string> | default = ""]
```

## queryrange_config
Expand Down
7 changes: 7 additions & 0 deletions pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ func (t *Loki) initQueryFrontend() (_ services.Service, err error) {
return nil, err
}
tp := httputil.NewSingleHostReverseProxy(tailURL)

director := tp.Director
tp.Director = func(req *http.Request) {
director(req)
req.Host = tailURL.Host
}

defaultHandler = httpMiddleware.Wrap(tp)
} else {
defaultHandler = frontendHandler
Expand Down