0

How to configure Nginx to log requests send to php-fpm into log? Goal is to have e.g. script path information ofter Nginx location etc. have been applied to.

frlan
  • 573
  • 1
  • 8
  • 27

1 Answers1

0

There is a section in your site configuration for php. You should just need to simply add an access_log directive within that section

  location ~ .php$ {
    fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
    include fastcgi_params;
    #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
    # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_pass unix:/run/php/php5.6-fpm.sock;
    access_log /var/log/nginx/phpfpmonly-access.log;
  }
Antony Gibbs
  • 515
  • 3
  • 12