mangoGoForward commented on issue #3931:
URL: https://github.com/apache/apisix/issues/3931#issuecomment-1044092298


   I tested it like this:
   
   1. Create a route
   
   ```bash
   $ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/hello",
       "plugins": {
           "redirect": {
               "http_to_https": true
           }
       }
   }'
   ```
   
   2. Test.
   
   ```bash
   $ curl http://127.0.0.1:9080/hello -i
   HTTP/1.1 301 Moved Permanently
   Date: Fri, 18 Feb 2022 07:48:32 GMT
   Content-Type: text/html
   Content-Length: 166
   Connection: keep-alive
   Location: https://127.0.0.1/hello
   Server: APISIX/2.12.0
   
   <html>
   <head><title>301 Moved Permanently</title></head>
   <body>
   <center><h1>301 Moved Permanently</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>
   ```
   
   How about add the second step to the [redirect 
document](http://apisix.apache.org/docs/apisix/plugins/redirect)? @tzssangglass 
@leslie-tsang 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to