ingress nginx redirect from www to https
问题 I'm trying to redirect http://www... and https://www... to https://... using ingress-nginx. How can I do that? I've tried adding the following custom configuration using the annotation nginx.ingress.kubernetes.io/server-snippet and nginx.ingress.kubernetes.io/configuration-snippet : # 1 if($host = "www.example.com") { return 308 https://example.com$request_uri; } # 2 server { server_name www.example.com; return 308 https://example.com$request_uri; } # 3 server_name www.example.com; return 308