I am wondering what the http block does in Nginx. I don't see many tutorials talking about when it is necessary to use that block, and many examples do not use it at all.
I am wondering what the http block does in Nginx. I don't see many tutorials talking about when it is necessary to use that block, and many examples do not use it at all.
The
http
block is required for any nginx configuration that is intended to act as a HTTP(S) server. It often isn't included in examples, because most people use nginx for HTTP(S) service, however if you're using nginx to proxy (for example) IMAP/POP3, you don't need ahttp
block.