1
0
Fork 0

Redirection: permanent move option.

This commit is contained in:
Ludovic Fernandez 2018-01-31 19:10:04 +01:00 committed by Traefiker
parent c944d203fb
commit 58d6681824
83 changed files with 622 additions and 8611 deletions

View file

@ -212,16 +212,21 @@ func getServers(instances []ecsInstance) map[string]types.Server {
}
func getRedirect(instance ecsInstance) *types.Redirect {
permanent := getBoolValue(instance, label.TraefikFrontendRedirectPermanent, false)
if hasLabel(instance, label.TraefikFrontendRedirectEntryPoint) {
return &types.Redirect{
EntryPoint: getStringValue(instance, label.TraefikFrontendRedirectEntryPoint, ""),
Permanent: permanent,
}
}
if hasLabel(instance, label.TraefikFrontendRedirectRegex) &&
hasLabel(instance, label.TraefikFrontendRedirectReplacement) {
return &types.Redirect{
Regex: getStringValue(instance, label.TraefikFrontendRedirectRegex, ""),
Replacement: getStringValue(instance, label.TraefikFrontendRedirectReplacement, ""),
Permanent: permanent,
}
}