0

This question has been asked a few times over the years:

  1. Nginx - Allow requests without a Host header
  2. Nginx processing requests without a host header

But I'm hoping the answer may have changed recently. I am working on deprecating a legacy application in which I have no control over the client behavior. Specifically, the clients are making requests via HTTP/1.1, but do not include a Host header. Nginx follows the RFC in this case and returns a 400 error. I need to override this behavior and accept these requests. Is there any way to do so?

Andrew Guenther
  • 447
  • 1
  • 4
  • 8
  • 2
    The standard hasn't changed. – user9517 Dec 28 '17 at 21:26
  • This seems like something you should be able to easily architect around. What have you tried so far? It might take more layers to your application if you must have this functionality but it's perfectly possible to work around it. – Bratchley Dec 28 '17 at 21:36
  • 1
    You might need to change the Nginx source code if you really need to do this. I wonder if another option might be to preprocess the requests with another application - a firewall, HAProxy, or a custom written piece of code. – Tim Dec 28 '17 at 21:38
  • 1
    I'd simply program a little proxy that modifies the headers for these clients. – Esa Jokinen Dec 28 '17 at 21:39

0 Answers0