nginx试图给我这样的资产文件。
获取http://www.lazyair.co/assets/kode/css/font-awesome.min.css
但那些文件不存在。实际的文件路径应该是丑陋的。
获取http://www.lazyair.co/assets/kode/css/font-awesome2131e1321e12qd.min.css
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
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;
}
config.serve_static_files = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
#config.assets.js_compressor = :yui
config.assets.css_compressor = :sass
config.assets.digest = true
%link{:href => asset_path("kode/css/root.css"), :rel =>
@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';