You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/06/12 07:42:38 UTC

[GitHub] [apisix-ingress-controller] haohello opened a new issue, #1084: request help: http to https redirect

haohello opened a new issue, #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084

   ### Issue description
   
   Use the following code to enable the https redirect for the  path `/bar`, however the https version of this path can't work correctly after this operation.
   ```
   kubectl exec -it -n ingress-apisix apisix-7584d75d9-lg522 -- curl http://127.0.0.1:9080/apisix/admin/routes/40f73b2a -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PATCH -d '
   {
   	"uri": "/bar",
   	"host": "code.devtaoism.com",
   	"vars": [
   		[
   			"scheme",
   			"==",
   			"http"
   		]
   	],
   	"plugins": {
   		"redirect": {
   			"uri" : "https://$host$request_uri",
   			"ret_code": 301
   		}
   	}
   }'
   ```
   The screenshot of the logs for the http to https redirect:
   
   ![image](https://user-images.githubusercontent.com/134774/173222672-e9e28e32-ad6a-4be2-9d6a-ec441d91b08c.png)
   
   
   
   ### Environment
   
   - your apisix-ingress-controller version (output of apisix-ingress-controller version --long): latest version
   - your Kubernetes cluster version (output of kubectl version):  v1.23.6+k3s1
   - if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a): ubuntu 22.04
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1278358346

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1156101292

   Have you checked out this document?
   https://apisix.apache.org/docs/apisix/FAQ/#how-do-i-redirect-http-traffic-to-https-with-apache-apisix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153124489

   Any ideas how to resolve this issue? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153117069

   The path `/foo` hasn't been set any https redirect rules and is working correctly for the https. Once if you set the https redirect rule the same as above, https access will be the same as above.
   
   The screenshot below is what it looks like when not setting any https redirect rules.
    
   ![image](https://user-images.githubusercontent.com/134774/173227473-33dafec3-4284-4e68-b9d4-0a0dc684aa99.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153478748

   @tokers There is already a working SSL certificate configured for the domain name `code.devtaoism.com` which is clearly shown in the screenshot for the path `/foo` , and [here is the link for your information](https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153117069). 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tokers commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153354946

   @haohello What's your ApisixRoute definition for the HTTPS version? Then route object you shown above has the check for scheme so that only requests which protocol is HTTP can match it, after you redirect the request, two questions come in:
   
   1. You don't have a certificate which CN or SANs match the domain `code.devtaoism.com`;
   2. You don't have a route to match this request, so APISIX just returns `404`;
   
   What you need to do are:
   
   1. configuring the SSL object for APISIX with the correct certificate and private key;
   2. configuring a new Route match rule to accept requests even its protocol is HTTPS;


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153721978

   ??


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153313969

   ??


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153115368

   The log shows that your certificate does not match the SNI
   
   Maybe you should use your domain name to access instead of your IP


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153116202

   ![image](https://user-images.githubusercontent.com/134774/173227319-edcb3613-c6b3-4b87-802c-93e1a4ae865a.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] github-actions[bot] closed issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #1084: request help: http to https redirect
URL: https://github.com/apache/apisix-ingress-controller/issues/1084


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153115960

   I'm using the domain name instead of IP address. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] haohello commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
haohello commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1153556314

   ??


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] github-actions[bot] commented on issue #1084: request help: http to https redirect

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #1084:
URL: https://github.com/apache/apisix-ingress-controller/issues/1084#issuecomment-1246118750

   This issue has been marked as stale due to 90 days of inactivity. It will be closed in 30 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org