mirror of https://github.com/perkeep/perkeep.git
website: ssl fixes
Change-Id: I2c2c4d95a15d0addeac3256360d54ec105bf4bdc
This commit is contained in:
parent
de5171b15b
commit
4658a2a3fb
|
@ -245,12 +245,13 @@ func main() {
|
||||||
mux.Handle("/static/", http.FileServer(path.Join(*root, "static"), "/static/"))
|
mux.Handle("/static/", http.FileServer(path.Join(*root, "static"), "/static/"))
|
||||||
mux.Handle("/talks/", http.FileServer(path.Join(*root, "talks"), "/talks/"))
|
mux.Handle("/talks/", http.FileServer(path.Join(*root, "talks"), "/talks/"))
|
||||||
|
|
||||||
gerritUrl, _ := http.ParseURL("http://127.0.0.1:8000/")
|
gerritUrl, _ := http.ParseURL("http://gerrit-proxy:8000/")
|
||||||
var gerritHandler http.Handler = http.NewSingleHostReverseProxy(gerritUrl)
|
var gerritHandler http.Handler = http.NewSingleHostReverseProxy(gerritUrl)
|
||||||
if *httpsAddr != "" {
|
if *httpsAddr != "" {
|
||||||
|
proxyHandler := gerritHandler
|
||||||
gerritHandler = http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
gerritHandler = http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||||
if req.TLS != nil {
|
if req.TLS != nil {
|
||||||
gerritHandler.ServeHTTP(rw, req)
|
proxyHandler.ServeHTTP(rw, req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
http.Redirect(rw, req, "https://camlistore.org"+req.URL.RawPath, http.StatusFound)
|
http.Redirect(rw, req, "https://camlistore.org"+req.URL.RawPath, http.StatusFound)
|
||||||
|
|
|
@ -17,6 +17,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-bottom: 1em">
|
<div style="margin-bottom: 1em">
|
||||||
$ git clone http://camlistore.org/r/p/camlistore
|
$ git clone https://camlistore.org/r/p/camlistore
|
||||||
</div>
|
</div>
|
||||||
</center>
|
</center>
|
||||||
|
|
Loading…
Reference in New Issue