I continuously receive `Invalid HTTP_HOST header` error email after I upgrade my django site from http to https

后端 未结 3 916
醉梦人生
醉梦人生 2020-12-09 09:24

Recently, I upgrade one of my django sites from http to https. However, after that, I continuously receive Invalid HTTP_HOST header error email while before I n

3条回答
  •  感情败类
    2020-12-09 09:47

    You need to add in a block

       location / {
    
       }
    

    this condition (for not-yourdomain request):

    if ( $host !~* ^(yourdomain.com|www.yourdomain.com)$ ) {
       return 444;
    }
    

    and

    sudo service nginx reload
    

提交回复
热议问题