Monday, July 2, 2018

Re: Invalid HTTP_HOST header when website being accessed by public IP

On zondag 1 juli 2018 19:10:15 CEST Tomasz Knapik wrote:

 

> Maybe you could restrict host headers at the nginx layer, but I don't

> think it's worth your effort...

 

If you think of it like that it seems like a lot of work. But if you simply setup a default server that redirects to the actual Django server with correct hostname, then all you need is 2 server blocks: 1 default, 1 with correct `server_name`.

 

See Request Processing for more background information and tricks.

--

Melvyn Sopacua

No comments:

Post a Comment