Nginx redirect http://www and naked http/https to https://www

前端 未结 4 1023
暖寄归人
暖寄归人 2021-01-02 12:16

I would like to redirect all traffic from the following domains:

  • http://domain.com
  • http://www.domain.com
  • http
4条回答
  •  太阳男子
    2021-01-02 13:12

    If you don't have a certificate for domain.com redirecting from https://domain.com to https://www.domain.com will not work, because before the browser gets the redirect it has to successfully establish the SSL connection (https is http inside SSL) and this fails because the certificate does not match.

提交回复
热议问题