How to fix nginx throws 400 bad request headers on any header testing tools?

前端 未结 7 760
滥情空心
滥情空心 2020-12-03 06:52

I have my site which is using nginx, and testing site with header testing tools e.g. http://www.webconfs.com/http-header-check.php but every time it says 400 bad request bel

相关标签:
7条回答
  • 2020-12-03 07:32

    I had the same issue and tried everything. This 400 happened for an upstream proxy. Debug logged showed absolutely nothing.

    The problem was in duplicate proxy_set_header Host $http_host directive, which I didn't notice initially. Removing duplicate one solved the issue immediately. I wish nginx was saying something other than 400 in this scenario, as nginx -t didn't complain at all.

    P.S. this happened while migrating from older nginx 1.10 to the newer 1.19. Before it was tolerated apparently.

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