【发布时间】:2025-12-07 04:05:02
【问题描述】:
我在生产环境中使用 sidekiq 运行 rails 4.1 应用程序。我已经使用 nginx + unicorn 部署了它。我还安装了sidekiq UI,如下所示,
mount Sidekiq::Web => '/sidekiq'
但是自从最近几天我尝试访问 sidekiq UI 时,sidekiq 的所有资产都返回 404,找不到。但它以前工作正常。但无法找到导致 404 的原因。
这是我的设置 我的应用程序的 nginx+unicorn 设置
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;
}
【问题讨论】:
标签: ruby-on-rails nginx unicorn sidekiq