-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Closed
Labels
kind/supportCategorizes issue or PR as a support question.Categorizes issue or PR as a support question.
Description
Hello,
I am not sure if it is a bug, but still I can't https redirect naked domain to www subdomain using from-to-www-redirect
annotation. I did lot of tests checking the ingress-controller logs and resulted Nginx config, and I will show you what is going on. AFAIK I need one server block for naked domain and one for www subdomain in order to handle SSL handshake.
- I create a block for example.com
Block example.com created without redirection. - I try to create a block for www.example.com with from-to-www-redirect
Logs says: Already exists an Ingress with "example.com" hostname. Skipping creation of redirection from "example.com" to "www.example.com".
Block www.example.com created without redirection.
// Not what I want because would redirect to naked but attempted anyway
- I create a block for www.example.com
Block www.example.com created without redirection. - I try to create a block for example.com with from-to-www-redirect
Logs says: Already exists an Ingress with "www.example.com" hostname. Skipping creation of redirection from "www.example.com" to "example.com".
Block example.com created without redirection.
- I create a block for www.example.com with from-to-www-redirect
Logs: the server example.com has SSL configured but the SSL certificate does not contains a CN for www.example.com. Redirects will not work for HTTPS to HTTPS
Redirect block "server_name example.com" added to nginx.conf - I create a block for example.com without from-to-www-redirect
Logs: Already exists an Ingress with "example.com" hostname. Skipping creation of redirection from "example.com" to "www.example.com"
Redirect block is removed from nginx conf!
// Not what I want because would redirect to naked but attempted anyway
- I create a block for example.com with from-to-www-redirect
Logs: the server www.example.com has SSL configured but the SSL certificate does not contains a CN for example.com. Redirects will not work for HTTPS to HTTPS
Redirect block is added to nginx.conf - I create a block for www.example.com without from-to-www-redirect
Logs: Already exists an Ingress with "www.example.com" hostname. Skipping creation of redirection from "www.example.com" to "example.com".
Redirect block is removed from nginx conf!
- I create a block for www.example.com with from-to-www-redirect
Logs the server example.com has SSL configured but the SSL certificate does not contains a CN for www.example.com. Redirects will not work for HTTPS to HTTPS
Redirect block "server_name example.com" added to nginx.conf - I create a block for example.com with from-to-www-redirect
Logs:
- Already exists an Ingress with "www.example.com" hostname. Skipping creation of redirection from "www.example.com" to "example.com".
- Already exists an Ingress with "example.com" hostname. Skipping creation of redirection from "example.com" to "www.example.com".
Redirect blocks are removed from nginx conf!
So the next question is, what am I doing wrong and how people normally do HTTPS to HTTPS redirection?! I can't be the first person to came across this.
Metadata
Metadata
Assignees
Labels
kind/supportCategorizes issue or PR as a support question.Categorizes issue or PR as a support question.