website: ssl fixes

Change-Id: I2c2c4d95a15d0addeac3256360d54ec105bf4bdc
This commit is contained in:
Brad Fitzpatrick 2011-06-21 14:50:27 -07:00
parent de5171b15b
commit 4658a2a3fb
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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>