Sidekiq UI is not loading assets - 404 not found

前提是你 提交于 2019-12-08 04:09:21

问题


I am having rails 4.1 application running with sidekiq on production. I have deployed it using nginx + unicorn. Also I have mounted sidekiq UI as follows,

mount Sidekiq::Web => '/sidekiq'

but since last few days when ever I try to access sidekiq UI, all assets of sidekiq returning 404, not found. But it was working previously fine. But not able to find what leads 404.

Here is my settings nginx+unicorn settings for my app

upstream sample_app {
  server unix:/tmp/sample_app.sock fail_timeout=0;
}

server {
  listen 80;
  server_name www.sample_app.com;

  root /home/deploy/applications/sample_app/current/public;

  # set expire to all assets
  location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ {
    expires max;
  }

  try_files $uri/index.html $uri @sample_app;

  location @sample_app {
    proxy_set_header X-Request-Start "t=${msec}";
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://sample_app;
  }

  error_page 500 502 503 504 /500.html;
  error_page 404 413 /404.html;
  client_max_body_size 50M;
  keepalive_timeout 10;
}

回答1:


After debugging, I able to solve it by adding following line

# set expire to all assets
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ {
  expires max;
  try_files $uri @sample_app;
}


来源:https://stackoverflow.com/questions/24454898/sidekiq-ui-is-not-loading-assets-404-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!