我正在生产带有sidekiq的rails 4.1应用程序。我使用nginx + unicorn部署了它。我也安装了sidekiq UI,如下所示,
mount Sidekiq::Web => '/sidekiq'
但是从最近几天我尝试访问sidekiq UI后,sidekiq的所有资产都返回404,找不到。但它以前工作得很好。但无法找到导致404的内容。
这是我的设置 我的应用程序的nginx +独角兽设置
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;
}
答案 0 :(得分:1)
调试后,我可以通过添加以下行来解决它
# set expire to all assets
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ {
expires max;
try_files $uri @sample_app;
}