August 2017
Intermediate to advanced
278 pages
8h 53m
English
Firstly, we define our upstream block directive and call it smtppool. There are three servers within this directive, which run on the same server as the NGINX and therefore listen on 127.0.0.1. A real-world scenario will have these running on external servers to help distribute the load. As there's no explicit load balancing method set, this will default to round robin.
Next, we defined a custom log format, which we named smtplog. Compared to the previous recipe's more basic format, this time we added logging for the port numbers, as well as the upstream server used.
Here's an example of what the logs produce:
1.2.3.4 64811 -> 26 [04/Jan/2017:23:43:00 +1000] 282 122 0.041 ==> 127.0.0.1:2501 1.2.3.4 64812 -> 26 [04/Jan/2017:23:43:00 ...
Read now
Unlock full access