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/12/08 07:09:25 UTC

[GitHub] [apisix] kellyseeme opened a new issue, #8483: use http to htts is not affect

kellyseeme opened a new issue, #8483:
URL: https://github.com/apache/apisix/issues/8483

   ### Description
   
   i set two route :
   curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f134336f236f87ad84b625c9f1' -X PUT -d '{
     "uri": "/*",
     "name": "back",
     "upstream_id": "mybackend",
     "status": 1,
     "host": "*.backend.com"
   }'
   
   curl http://127.0.0.1:9180/apisix/admin/routes/httptohttps -H 'X-API-KEY: edd1c9f134336f236f87ad84b625c9f1' -X PUT -d '{
       "uri": "/*",
       "plugins": {
           "redirect": {
               "http_to_https": true
           }
       }
   }'
   
   in test,the request of http not redirect to https,the second route is not affected. how can i change the route?
   
   ### Environment
   
   - APISIX version (run `apisix version`): 2.15.1
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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] kellyseeme commented on issue #8483: use http to htts is not affect

Posted by GitBox <gi...@apache.org>.
kellyseeme commented on issue #8483:
URL: https://github.com/apache/apisix/issues/8483#issuecomment-1342494834

   i find this is work ,use one rules:
   curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034331f236ff7ad84b625c8f1' -X PUT -d '{
       "uri": "/*",
       "host": "*.backend.com",
       "upstream_id": "backend",
       "plugins": {
           "redirect": {
               "http_to_https": true
           }
       }
   }'
   if the shema is https,this plugin is no effect?


-- 
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] tokers commented on issue #8483: use http to htts is not affect

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

   Your two routes are identical. Which one will be hit is not known. Try to set different priority for them.
   
   If you don't know the route priority, please search for it on apisix.apache.org.


-- 
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] kellyseeme commented on issue #8483: use http to htts is not affect

Posted by GitBox <gi...@apache.org>.
kellyseeme commented on issue #8483:
URL: https://github.com/apache/apisix/issues/8483#issuecomment-1342245539

   if i use the vars ,http will directly return the result,not redirect to https
   "vars": [
           [
               "scheme",
               "==",
               "http"
           ]
       ],
       "plugins": {
           "redirect": {
               "uri": "https://$host$request_uri",
               "ret_code": 301
           }
       }


-- 
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] kellyseeme commented on issue #8483: use http to htts is not affect

Posted by GitBox <gi...@apache.org>.
kellyseeme commented on issue #8483:
URL: https://github.com/apache/apisix/issues/8483#issuecomment-1342185045

   if i change the routes name,then the https is not affected,error log is :
   [error] 19072#19072: *7957 [lua] init.lua:540: http_access_phase(): failed to set upstream: missing upstream configuration in Route or Service, client
   curl http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f134336f236f87ad84b625c9f1' -X PUT -d '{
   "uri": "/*",
   "plugins": {
   "redirect": {
   "http_to_https": true
   }
   }
   }'
   
   curl http://127.0.0.1:9180/apisix/admin/routes/httptohttps -H 'X-API-KEY: edd1c9f134336f236f87ad84b625c9f1' -X PUT -d '{
   "uri": "/",
   "name": "back",
   "upstream_id": "mybackend",
   "status": 1,
   "host": ".backend.com"
   
   }'


-- 
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] kellyseeme closed issue #8483: use http to https is not affect

Posted by GitBox <gi...@apache.org>.
kellyseeme closed issue #8483: use http to https is not affect
URL: https://github.com/apache/apisix/issues/8483


-- 
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] tzssangglass commented on issue #8483: use http to htts is not affect

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8483:
URL: https://github.com/apache/apisix/issues/8483#issuecomment-1347786898

   I didn't understand what you wanted to do.
   
   > if the shema is https,this plugin is no effect?
   
   yes, we have code like:
   
   ```
       local _scheme = proxy_proto or core.request.get_scheme(ctx)
       if conf.http_to_https and _scheme == "http" then
   ```


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