add static redirect

This commit is contained in:
Manuel Zapf 2018-10-29 16:48:06 +01:00 committed by Traefiker Bot
parent 993caf5058
commit c6dd1dccc3
5 changed files with 21 additions and 36 deletions

View file

@ -163,6 +163,14 @@ func (s *Server) buildServerEntryPointMiddlewares(serverEntryPointName string, s
}
}
if s.entryPoints[serverEntryPointName].Configuration.Redirect != nil {
redirectHandlers, err := s.buildEntryPointRedirect()
if err != nil {
return nil, fmt.Errorf("failed to create redirect middleware: %v", err)
}
serverMiddlewares = append(serverMiddlewares, redirectHandlers[serverEntryPointName])
}
if s.entryPoints[serverEntryPointName].Configuration.Auth != nil {
authMiddleware, err := mauth.NewAuthenticator(s.entryPoints[serverEntryPointName].Configuration.Auth, s.tracingMiddleware)
if err != nil {