Minify js and css are not loading with nginx php-fpm. In apache its working without any issue
In browser net-panel shows 404 Not Found Error. But when I open the URL directly with the below link in the browser it can display the content.
my.domain.com/index.php/min/91d4aa76decb6a22e80e3ab8a546d847.css (or)my.domain.com/min/91d4aa76decb6a22e80e3ab8a546d847.css
Below is my nginx configuration.
server {
listen 443 ssl http2;
server_name my.domain.com;
root /var/www/html/website;
#Access Log
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ {
expires 30d;
log_not_found off;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcgi_buffer_size 64K;
fastcgi_buffers 128 8k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
}
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
}
[b]
Below is the main.php config for minify controller.[/b]
'clientScript' => array(
'class'=>'ext.ExtACClientScriptMinify.components.ExtACClientScriptMinify',
'controller'=>'min', // the same value set in controllerMap
'debug' => false, // optional: default false
'cache' => 'file', // optional: default 'off' Others values 'file', 'apc', 'memcache'
'cachePath' => '', // for file caching; optional: default '' (Yii::app() -> runtimePath.'/minify_cache'),
//'maxAge' => 60*60*24*30, //optional: default 1800 (Cache-Control: max-age value sent to browser (in seconds))
),