A
A
atis //2016-11-10 23:41:10
Ruby on Rails
atis //, 2016-11-10 23:41:10

Why is the Rails route not processing requests?

Such a problem.
Route

Rails.application.routes.draw do
    get '/welcome/index'
    get '/feed/index', to: 'feed#index'

    root 'welcome#index'
end

nginx config
server {
        listen 80;

        passenger_enabled on;
        rails_env development;

        root /var/www/example.com/public;

        index index.html index.htm index.nginx-debian.html;

        server_name example.com www.example.com;

        location / {
                try_files $uri $uri/ =404;
        }
}

Only root in the route is processed.
A request to /welcome/index or /feed/index results in a 404 from Nginx.
As I understand it, the request does not reach the passenger and everything dies at the nginx level.
Rails -v 5.0.0.1
Ruby -v 2.3.0p0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
atis //, 2016-11-11
@atis2345

stackoverflow.com/questions/24257250/nginx-passang...
As a result, the nginx config should look like this:

server {
        listen 80;

        passenger_enabled on;
        rails_env development;

        root /var/www/example.com/public;

        index index.html index.htm index.nginx-debian.html;

        server_name example.com www.example.com;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question