How do I adapt my Nginx logs to only record page views

How do I adapt my Nginx logs to only record page views of my Ghost website?

So far I have tried disabling logging of page assets with a location block like this in my site’s server block:
location /assets {
access_log off;
}

I have placed the location block in the server block above the proxy config, as well as nested in with the proxy config, and in each instance my Ghost site stops serving images, returning a 404 Not Found error for the images. This is unexpected, log settings should not conflict with image serving.

My aim here is to produce a server log to postprocess with GoAccess. I only want to record HTML page views to that log file, and not every page asset (such as images, CSS files, etc…). Any tips please?

Ghost version: 2.23.2

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.