Yii Framework Forum: Minify js and css not loading in nginx php-fpm - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Minify js and css not loading in nginx php-fpm Minify js and css nginx not working Rate Topic: -----

#1 User is offline   Jaga 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-March 17

Posted 31 March 2017 - 06:54 AM

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;

}

Below is the main.php config for minify controller.


'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))
),
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,184
  • Joined: 17-January 09
  • Location:Russia

Posted 01 April 2017 - 01:04 PM

Check nginx error log.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users