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:00:28 UTC

[GitHub] [apisix] kaktos commented on issue #6078: request help: Use plugin redirect for http_to_https,the browser access unlimited 301.

kaktos commented on issue #6078:
URL: https://github.com/apache/apisix/issues/6078#issuecomment-1011772963


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


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