From 0b4a8792031d0132e38b2792c040aa660d1ea9fb Mon Sep 17 00:00:00 2001 From: Hans Hasselberg Date: Mon, 17 Dec 2018 19:35:03 +0100 Subject: [PATCH] ui: serve /robots.txt when UI is enabled. (#5089) * serve /robots.txt * robots.txt: disallow everything --- agent/http.go | 1 + ui-v2/public/robots.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/http.go b/agent/http.go index 73e9925a2c..40344d307c 100644 --- a/agent/http.go +++ b/agent/http.go @@ -219,6 +219,7 @@ func (s *HTTPServer) handler(enableDebug bool) http.Handler { uifs = &redirectFS{fs: uifs} } + mux.Handle("/robots.txt", http.FileServer(uifs)) mux.Handle("/ui/", http.StripPrefix("/ui/", http.FileServer(uifs))) } diff --git a/ui-v2/public/robots.txt b/ui-v2/public/robots.txt index f5916452e5..4542354a8c 100644 --- a/ui-v2/public/robots.txt +++ b/ui-v2/public/robots.txt @@ -1,3 +1,3 @@ # http://www.robotstxt.org User-agent: * -Disallow: +Disallow: * \ No newline at end of file