how to log http vs. https?

Igor Sysoev is at rambler-co.ru
Wed May 21 19:16:08 MSD 2008


On Wed, May 21, 2008 at 08:02:22AM -0700, Rt Ibmer wrote:

> 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!

$server_port - 80/443
$scheme - http/https


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list