ERROR: Invalid HTTP_HOST header: '/webapps/../gunicorn.sock'

后端 未结 2 595
清歌不尽
清歌不尽 2020-12-10 03:26

After I deployed my Django App last night I got tons of strange Emails saying:

ERROR: Invalid HTTP_HOST header: \'/webapps/example_com/run/gunicorn.sock
         


        
2条回答
  •  爱一瞬间的悲伤
    2020-12-10 03:31

    I found the answer to my my question in a django bug report.

        proxy_set_header Host $http_host;
    

    has to be replaced with:

        proxy_set_header Host $host;
    

    to make nginx pass the correct headers from that on instead of the gunicorn socket the requested page was in the django alerts.

提交回复
热议问题