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/02/19 09:27:52 UTC

[GitHub] [apisix] mangoGoForward commented on a change in pull request #6378: docs: add curl test for redirect plugin's `http_to_https`.

mangoGoForward commented on a change in pull request #6378:
URL: https://github.com/apache/apisix/pull/6378#discussion_r810469623



##########
File path: docs/en/latest/plugins/redirect.md
##########
@@ -124,6 +124,17 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f1
 }'
 ```
 
+Testing based on the above examples :
+
+```shell
+$ curl http://127.0.0.1:9080/hello -i
+HTTP/1.1 301 Moved Permanently
+...
+Location: https://127.0.0.1/hello

Review comment:
       Why should be `9443`? and the default port of `https` is `443`.
   When `http_to_https` is set to true and the request is HTTP, it will be automatically redirected to HTTPS with 301 response code, and the URI will keep the same as client request.
   
   https://github.com/apache/apisix/blob/9b98f1d13187c58195543bd48cb8b66e33aeab27/apisix/plugins/redirect.lua#L155-L166




-- 
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