nginx redirect loop with ssl

前端 未结 2 945
太阳男子
太阳男子 2020-12-31 18:38

This is a very similar problem to Nginx configuration leads to endless redirect loop but that discussion has not led me to an answer yet. I\'m learning how to work with ngin

相关标签:
2条回答
  • 2020-12-31 18:56

    I've toyed around with other answers but nothing worked for me. Then I realized since I use Cloudflare the problem may not be in the server but with Cloudflare. Lo and behold when I set my SSL to Full (Strict) everything works as it should!

    0 讨论(0)
  • 2020-12-31 19:00

    When nginx encounters a https protocol it thinks it is still using http as the protocol and is not being forwarded with the rest of the headers, try adding:

    proxy_set_header        X-Forwarded-Proto $scheme;
    

    in your location blocks to fix it.

    0 讨论(0)
提交回复
热议问题