78 404 when the application put under nginx subdirectory with proxy pass (#79)
* use http.FileServer insetead of custom middleware * fixed behavior under reverse proxy * enabled reverse proxy subfolder as "domain value" * domain validation * code refactoring * code refactoring * updated translation
This commit is contained in:
@@ -43,7 +43,6 @@ func RunBlocking(port int, frontend fs.FS) {
|
||||
mq: mq,
|
||||
})
|
||||
|
||||
// http-post
|
||||
go gracefulShutdown(srv, &db)
|
||||
go autoPersist(time.Minute*5, &db)
|
||||
|
||||
@@ -59,12 +58,9 @@ func newServer(c serverConfig) *http.Server {
|
||||
r.Use(cors.AllowAll().Handler)
|
||||
r.Use(middleware.Logger)
|
||||
|
||||
sh := middlewares.NewSpaHandler("index.html", c.frontend)
|
||||
sh.AddClientRoute("/settings")
|
||||
sh.AddClientRoute("/archive")
|
||||
sh.AddClientRoute("/login")
|
||||
app := http.FileServer(http.FS(c.frontend))
|
||||
|
||||
r.Get("/*", sh.Handler())
|
||||
r.Mount("/", app)
|
||||
|
||||
// Archive routes
|
||||
r.Route("/archive", func(r chi.Router) {
|
||||
|
||||
Reference in New Issue
Block a user