How to fix routing errors from rails in production mode?

If I try to access some random string in the url of my rails application, for example /asdfasdifjasdfkj, then I see a rails error message

Routing error

No route matches "/asdfasdifjasdfkj" with {:method=>:get}

Even if I'm in production mode. Clearly, I do not want real users to see this, and would prefer a 404 page. Does anyone know what is going wrong and how can I fix it?

+5
source share
1 answer

To get 404, you need to start the server in a production environment and use the external IP address, not the local / loopback ip address in the URL.

:

  def local_request?
    return false
  end
+10

All Articles