Created
August 27, 2017 02:07
-
-
Save sandcastle/810dee50e96a8214519ba0989f6af964 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