mirror of
https://github.com/nxshock/gonx.git
synced 2024-11-27 17:11:01 +05:00
Compare commits
2 Commits
5903c6fbcd
...
ea03e2c4fb
Author | SHA1 | Date | |
---|---|---|---|
ea03e2c4fb | |||
e9ad16b83e |
2
PKGBUILD
2
PKGBUILD
@ -1,5 +1,5 @@
|
|||||||
pkgname=gonx
|
pkgname=gonx
|
||||||
pkgver=0.0.3
|
pkgver=0.0.4
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='Simple reverse proxy server'
|
pkgdesc='Simple reverse proxy server'
|
||||||
arch=('x86_64' 'aarch64')
|
arch=('x86_64' 'aarch64')
|
||||||
|
2
main.go
2
main.go
@ -48,7 +48,7 @@ func main() {
|
|||||||
slog.Debug("Starting HTTP listener", slog.String("addr", config.HttpListenAddr))
|
slog.Debug("Starting HTTP listener", slog.String("addr", config.HttpListenAddr))
|
||||||
|
|
||||||
smux := http.NewServeMux()
|
smux := http.NewServeMux()
|
||||||
smux.Handle(defaultAcmeChallengePath, http.StripPrefix(defaultAcmeChallengePath, http.FileServer(http.Dir(config.AcmeChallengePath))))
|
smux.Handle(defaultAcmeChallengePath, http.FileServer(http.Dir(config.AcmeChallengePath)))
|
||||||
smux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
smux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Redirect(w, r, "https://"+r.Host+r.RequestURI, http.StatusMovedPermanently)
|
http.Redirect(w, r, "https://"+r.Host+r.RequestURI, http.StatusMovedPermanently)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user