0

I am maintaining nginx as the load balancer for the servers. Now I am maintaining the access-logs, I need the details of the port of which I am receiving the request from the external servers.

For example if any external server calls, my server, I am getting the ip details in the access-log , I also need through which port the external server is calling to my server.

How to customize the log format in order to log the detail of port number like 8080 0r 443?

  • I assume these ports are already configured in separate server blocks, so just specify different log files for them? – Gerald Schneider Jun 21 '22 at 12:43
  • Start from reading documentation: [`access_log`](http://nginx.org/r/access_log), [`log_format`](http://nginx.org/r/log_format), [`$server_port`](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_server_port) – Ivan Shatsky Jun 21 '22 at 21:22

0 Answers0