For ngnix you have to write
fastcgi_param MAGE_PROFILER html
into ngnix.conf file, you will find below code.
File : ngnix.conf
#PHP entry point for main application
location ~ (index|get|static|report|404|503)\.php$ {
try_files $uri =404;
fastcgi_pass fastcgi_backend;
fastcgi_buffers 1024 4k;
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=768M \n max_execution_time=600";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;
# to configure profiler in Magento 2
fastcgi_param MAGE_PROFILER $MAGE_PROFILER;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
set $MAGE_PROFILER html; this variable value can be set in virtual host config file or directly you can set html in place of variable $MAGE_PROFILER.
/etc/ngnix/conf.d/
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/ssl/certs/local/local.pem;
ssl_certificate_key /etc/ssl/certs/local/local.key;
server_name example.com;
set $MAGE_MODE developer;
set $MAGE_PROFILER html;
include /example.com/html/www/nginx.conf;
}