Sitemap
chandan kumar singha

chandan kumar singha

Ingress configuration to route http to https

Redirecting http traffic to https via nginx-ingress.

Get chandan kumar singha’s stories in your inbox

Join Medium for free to get updates from this writer.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/server-snippet: |
if ($http_x_forwarded_proto = 'http') {
return 301 https://$server_name$request_uri;
}
nginx.ingress.kubernetes.io/ssl-redirect: "true"
generation: 6
name: my-route
namespace: ns
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: my-svc
servicePort: 80
path: /
- host: www.example.com
http:
paths:
- backend:
serviceName: my-svc
servicePort: 80
path: /

--

--