~emersion/public-inbox

kimchi: fix site configs with path in uri v3 PROPOSED

Jonathan Halmen: 1
 fix site configs with path in uri

 2 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/public-inbox/patches/15424/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH kimchi v3] fix site configs with path in uri Export this patch

This makes site configs such as the following work

site foo.example.org/foo/ {
  file_server /path/to/index/html/
}
---
I took the liberty to include the trailing slash in the manual as well
to have them there explicitly.

 directives.go | 2 +-
 kimchi.1.scd  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/directives.go b/directives.go
index 7c29464..952b474 100644
--- a/directives.go
+++ b/directives.go
@@ -115,7 +115,7 @@ func parseSite(srv *Server, dir *scfg.Directive) error {
			}
		}

		ln.Mux.Handle(pattern, handler)
		ln.Mux.Handle(pattern, http.StripPrefix(path, handler))
	}
	return nil
}
diff --git a/kimchi.1.scd b/kimchi.1.scd
index d5f5a46..288582b 100644
--- a/kimchi.1.scd
+++ b/kimchi.1.scd
@@ -41,10 +41,10 @@ The following directives are supported:

	The following URIs are supported:

	- _[http://][host][:port][/path]_ sets up an HTTP listener with an
	- _[http://][host][:port][/path/]_ sets up an HTTP listener with an
	  automatic HTTPS redirection. This is useful when used together with a
	  TLS reverse proxy.
	- _http+insecure://[host][:port][/path]_ sets up an HTTP listener without
	- _http+insecure://[host][:port][/path/]_ sets up an HTTP listener without
	  HTTPS redirection.

	If the host is omitted, requests for all hosts will be handled. If the port
-- 
2.29.2