403 Forbidden error with Ruby on Rails app, Nginx and Passenger

443 Views Asked by At

I have a server where I run a Decidim application built in Ruby on Rails. I aim to use Nginx and Passenger to deploy it, but I'm receiving a 403 Forbidden error. The nginx.conf content is below:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    passenger_root /root/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/passenger-6.0.17;
    passenger_ruby /root/.rbenv/shims/ruby;
    include       mime.types;
    default_type  application/octet-stream;
    passenger_app_env development;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;
        root /var/www/decidim_application/public;
        passenger_enabled on;
    }
}

I tried to configure the nginx.conf in several ways, but none of them worked for me.

UPDATE: The log information of Ruby on Rails is below.

DEPRECATION WARNING: Initialization autoloaded the constants Decidim::Meetings::CloseMeetingReminderGenerator and Decidim::Budgets::OrderReminderGenerator.

Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.

Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload Decidim::Meetings::CloseMeetingReminderGenerator, for example,
the expected changes won't be reflected in that stale Class object.

These autoloaded constants have been unloaded.

In order to autoload safely at boot time, please wrap your code in a reloader
callback this way:

    Rails.application.reloader.to_prepare do
      # Autoload classes and modules needed at boot time here.
    end

That block runs when the application boots, and every time there is a reload.
For historical reasons, it may run twice, so it has to be idempotent.

Check the "Autoloading and Reloading Constants" guide to learn more about how
Rails autoloads and reloads.
 (called from <main> at /var/www/decidim_application/config/environment.rb:5)
0

There are 0 best solutions below