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/01/13 04:13:50 UTC

[GitHub] [apisix] leslie-tsang edited a comment on issue #6078: request help: Use plugin redirect for http_to_https,the browser access unlimited 301.

leslie-tsang edited a comment on issue #6078:
URL: https://github.com/apache/apisix/issues/6078#issuecomment-1011779523


   > Maybe I encountered the same problem. The reason I found is that our APISIX behind a proxy that responsed for decrypted the TLS and proxied always HTTP scheme to APISIX. let's see the redirect plugin code:
   > 
   > ```lua
   > if conf.http_to_https and ctx.var.scheme == "http" then
   > -- ignore
   > end
   > ```
   > 
   > It will makes the redirect loop apparently.
   > 
   > the resolution is patching this plugin just like:
   > 
   > ```lua
   > local proxy_proto = core.request.header(ctx, "x-forwarded-proto")
   > local _scheme = proxy_proto and proxy_proto or ctx.var.scheme
   > if conf.http_to_https and _scheme == "http" then
   > -- ignore
   > end
   > ```
   
   Hello there, @ke4qqq Would you like to submit a PR to fix it ? Thanks.


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