ruby on rails - nginx load wrong asset file path in production mode -


the nginx tried give me following assets files that.

get http://www.lazyair.co/assets/kode/css/font-awesome.min.css

but files doesnt exist. actual file path should ugly.

get http://www.lazyair.co/assets/kode/css/font-awesome2131e1321e12qd.min.css

demo website

buggy root cause on nginx.conf

  location ^~ /assets/ {     gzip_static on;     expires max;     add_header cache-control public;   } 

nginx.conf

  root /home/sample/rails-app/public ;    location ^~ /assets/ {     gzip_static on;     expires max;     add_header cache-control public;   }    try_files $uri/index.html $uri @rails-app;    location @rails-app {     proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;     proxy_set_header host $http_host;     proxy_redirect off;     proxy_pass http://rails-app;     # reverse proxy cache     proxy_cache default;     proxy_cache_lock on;     proxy_cache_use_stale updating;     add_header x-cache-status $upstream_cache_status;   } 

production.rb

  config.serve_static_files = false    # compress javascripts , css.   config.assets.js_compressor = :uglifier   #config.assets.js_compressor = :yui   config.assets.css_compressor = :sass      config.assets.digest = true 

application.html.haml

%link{:href => asset_path("kode/css/root.css"), :rel =>  

root.css.scss

@import 'font-awesome.min.css';  /* ================================================ main css ================================================ */ /* bootstrap main css file (unedited) */ @import 'bootstrap.css';  /* theme style */ @import 'style.css';  /* responsive style */ @import 'responsive.css';  /* shortcuts css codes */ @import 'shortcuts.css';  /* ================================================ plugin css ================================================ */ /* awesome bootstrap checkbox */ @import 'plugin/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css';  /* bootstrap select */ @import 'plugin/bootstrap-select/bootstrap-select.css';  /* bootstrap select */ @import 'plugin/bootstrap-toggle/bootstrap-toggle.min.css';  /* bootstrap wysihtml5 */ @import 'plugin/bootstrap-wysihtml5/bootstrap-wysihtml5.css';  /* summernote */ @import 'plugin/summernote/summernote.css'; @import 'plugin/summernote/summernote-bs3.css';  /* sweet alert */ @import 'plugin/sweet-alert/sweet-alert.css';  /* data tables */ @import 'plugin/datatables/datatables.css';  /* chartist */ @import 'plugin/chartist/chartist.min.css';  /* rickshaw */ @import 'plugin/rickshaw/rickshaw.css'; @import 'plugin/rickshaw/detail.css'; @import 'plugin/rickshaw/graph.css'; @import 'plugin/rickshaw/legend.css';  /* date range picker */ @import 'plugin/date-range-picker/daterangepicker-bs3.css';  /* full calendar */ @import 'plugin/fullcalendar/fullcalendar.css'; 


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -