how to log http vs. https?

Rt Ibmer rtibmx at
Wed May 21 19:02:22 MSD 2008

I would like to add information to my log to tell me whether a request was received and handled over http or if it was over https (I have nginx set up to handle ssl and non-ssl for the same server/ip/host).

Right now I am logging $request which is just the relative portion of the URL ("/path/to/file.htm").  I assume I could change this to $request_uri and it would log the full uri including the http:// or https:// part.  However that will add unnecessary size to my files.

So instead I was wondering if there was a variable like $port I could log so I can see whether the answer is 80 vs. 443 which would tell me what I want to know in the logs. Is this possible? Thanks!


More information about the nginx mailing list