Nginx +乘客只显示根页面/路径,所有其他路由失败,404 Not Found.我知道nginx和乘客必须正在运行才能正确显示根路径.这是网站的条目 - 可用:
server {
listen 80;
server_name staging.redacted.com; # Replace this with your site's domain.
passenger_enabled on;
passenger_app_env staging;
keepalive_timeout 300;
client_max_body_size 4G;
root /var/www/staging.redacted.com/current/public; # Set this to the public folder location of your Rails application.
#try_files $uri/index.html $uri.html $uri;
try_files $uri $uri/ =404;
}
Run Code Online (Sandbox Code Playgroud)
routes.rb - 即使它们都工作并通过他们的规范.
Rails.application.routes.draw do
resources :users
resources :brand_api_keys
resources :ir_service_buckets
resources :ir_service_images
resources :ir_services do
resources :ir_service_buckets do
resources :ir_service_images
end
end
resources :devices do
resources :scans
end
resources …Run Code Online (Sandbox Code Playgroud)