title: ActionController::RoutingError (No route matches [GET]) on amazon EC2 production
body: <p>I have deployed my application on amazon ec2 instance with nginx and passenger and its working proper while I am calling <code>api.subdomain.domain.com/admin</code> and its work perfectly as I want to run.</p>
  
  <p>But While I am calling url <code>api.subdomain.domain.com/v1/products</code> then I am getting below errors. Its properly working on local with development as well production mode. Only API call is not working. </p>
  
  <p>I have used <code>ruby 2.2.2</code> and <code>rails 4.2.3</code>.</p>
  
  <p>Let me know if anyone wants more details regarding the issue.</p>
  
  <pre><code>ActionController::RoutingError (No route matches [GET] "/v1/products"):
  App 7773 stdout:   actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  App 7773 stdout:   actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  App 7773 stdout:   railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
  App 7773 stdout:   railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
  App 7773 stdout:   activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  App 7773 stdout:   activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
  App 7773 stdout:   activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
  App 7773 stdout:   railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
  App 7773 stdout:   actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  App 7773 stdout:   rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  App 7773 stdout:   rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  App 7773 stdout:   activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  App 7773 stdout:   actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
  App 7773 stdout:   rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  App 7773 stdout:   railties (4.2.3) lib/rails/engine.rb:518:in `call'
  App 7773 stdout:   railties (4.2.3) lib/rails/application.rb:165:in `call'
  App 7773 stdout:   /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
  App 7773 stdout:   /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
  App 7773 stdout:   /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
  App 7773 stdout:   /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
  App 7773 stdout:   /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
  App 7773 stdout: 
  </code></pre>
  
  <p>My routes.rb file:</p>
  
  <pre><code>Rails.application.routes.draw do
    devise_for :admin_users, ActiveAdmin::Devise.config
    ActiveAdmin.routes(self)
  
    constraints :subdomain =&gt; 'api' do
      namespace :api, path: nil, defaults: {format: 'json'} do
        namespace :v1 do
          get "/products" =&gt; "products#all_details"
        end
  
        namespace :v2 do
          get "/products" =&gt; "products#all_details"
        end
      end
    end
  end
  </code></pre>
  
  <p>When I do rake routes then I got this routes</p>
  
  <pre><code>api_v1_products GET        /v1/products(.:format)                    api/v1/products#all_details {:subdomain=&gt;"api", :format=&gt;"json"}
  </code></pre>