-
-
Save gokusenz/fe9e212c2437c3fb9ba9f17c376564ae to your computer and use it in GitHub Desktop.
An example of a ingress redirect using kubernetes and nginx `configuration-snippet`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Ingress | |
apiVersion: extensions/v1beta1 | |
metadata: | |
name: redirect-ingress | |
annotations: | |
ingress.kubernetes.io/configuration-snippet: | | |
if ($host ~ ^(.+)\.somedomain\.io$) { | |
return 301 https://$1.domain.io$request_uri; | |
} | |
spec: | |
rules: | |
- host: "*.domain.io" | |
http: | |
paths: | |
- path: / | |
backend: | |
serviceName: the-app | |
servicePort: 8002 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment