This had me scratching my head for a while, I had been writing a test where I was using the server_addr_for_client section with a non 127.0.0.1 value, and I included the --curl in the test and set log_level('debug');.
The test was failing, and the curl command printed was not reflecting my server_addr_for_client value, which led me to believe it was making the request to the wrong server. After a fair bit of debugging, i discovered it was making the request to the correct server address, but the logs generated by test-nginx were wrong.
This patch fixes the logging in several places to use server_addr, which may be overridden by the server_addr_for_client section, but otherwise will default to ServerAddr
Please let me know if anything else is required for this contribution. I'd be happy if other folks didn't spend time debugging this like I did 🙃
This had me scratching my head for a while, I had been writing a test where I was using the
server_addr_for_client
section with a non127.0.0.1
value, and I included the--curl
in the test and setlog_level('debug');
.The test was failing, and the curl command printed was not reflecting my
server_addr_for_client
value, which led me to believe it was making the request to the wrong server. After a fair bit of debugging, i discovered it was making the request to the correct server address, but the logs generated by test-nginx were wrong.This patch fixes the logging in several places to use
server_addr
, which may be overridden by theserver_addr_for_client
section, but otherwise will default toServerAddr
Please let me know if anything else is required for this contribution. I'd be happy if other folks didn't spend time debugging this like I did 🙃