English 中文(简体)
未装上Sinatra装机、薄板和gin子的资产
原标题:Assets not loaded for a mounted Sinatra app with thin and nginx

我有一个简单的铁路机,安装在routes.rb上。

require  resque/server 
require  resque_scheduler 


    MyApp::Application.routes.draw do

        authenticate :user do
            mount Resque::Server.new, :at => "/tasks"
        end
        ...
        ...

沿途 Mount光,使用设计的认证。 然而,在生产过程中,这些资产没有装上Resque服务器,而主要铁路的资产则适当装载。

最佳回答

在研究这一问题后,我为我工作,gin子和薄子:

require  resque/server 

class SecuredResqueServer < Resque::Server
  set :static, true
  set :root, Resque::Server.root
end

路线档案如下:

    require  resque/server 
    require  resque_scheduler 
    require  ./app/secured_resque_server 


    MyApp::Application.routes.draw do
    ...
    ...
    authenticate :user do
        mount SecuredResqueServer.new, :at => "/tasks"
    end
    ...
    ...

一、导 言

config.action_dispatch.x_sendfile_header = "X-Sendfile"

在生产过程中。 页: 1

config.action_dispatch.x_sendfile_header =  X-Accel-Redirect 

第三,在一些情况下,铁路的原产地如下:

server{
        ...
        ...
        location ~*.(jpeg|jpg|gif|png|ico|css|bmp|js)$ {
                root /PATH_TO_APP/public;
        }
        ...
        ...
      }

<PATH_TO_APP 是应用根名录的途径。 这种地点申报使资产无法从任何其他地点装上安装的机车或发动机。 因此,需要删除/处理。

最后,不要忘记使用<条码>Ctrl+F5,强迫上载:]

问题回答

暂无回答




相关问题
Rails: Proxy Pass?

I ve got a web-app that I want to migrate to Rails, which is currently just plain HTML with an Apache proxy to another server, running a custom database/webserver that serves the site s dynamic ...

MVC routing is not handling one of my directories

I m using ASP.NET MVC with IIS 7.0. I ve got 404 errors hooked up fine through my Application_Error override. In addition to "Controllers", "Models", "Helpers" etc. I have a directory called Files ...

Ruby on Rails conditional routing

I have a site listing many jobs, but I also want each account to be able to access its jobs in one place. Thus, I am using these routes: map.resources :jobs map.resource :account, :has_many => :...

Clean URL s using OpenCart s router class

How do you write clean URL s in OpenCart using their built in Router class? Here is my .htaccess file: RewriteEngine On RewriteRule ^(system) - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...

subdomain routing to multiple controller issue

I have a site: www.mydomain.com where we have administrative controls hidden away from normal customer view. I would like to only access the administrative features under a subdomain such as admin....

Can controller names in RESTful routes be optional?

With a standard map.resource routing mechanics and several nested resources the resultant routes are unnecessarily long. Consider the following route: site.org/users/pavelshved/blogs/blogging-horror/...

Help with rails routes

Im having a little trouble setting up routes. I have a users controller/model/views set up restfully so users is set up to be a resource in my routes. I want to change that to be usuarios ...

热门标签