Nginx + Passenger - 403 Forbidden - Ruby on Rails

时间:2018-06-04 13:07:51

标签: ruby-on-rails ubuntu nginx passenger http-status-code-403

我正在使用Nginx& amp ;;在AWS Ubuntu 16.04 LTS上设置Rails应用程序。乘客。我收到 403 Forbidden 错误。我检查了许可和所有权,但似乎它不起作用。

Ruby版本:2.5.1。

Nginx.conf
/etc/nginx/nginx.conf下,我正在使用deploy用户。除了此文件中的user deploy之外,我没有更改任何内容。这是片段:

user deploy;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

Passenger.conf :更改了此文件中的passenger_ruby路径。我正在使用rvenv

passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /home/deploy/.rbenv/shims/ruby;

网站已启用/默认:在此处,我删除了所有内容并关注

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        server_name ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com
        passenger_enabled on;
        rails_env    production;

        root /var/www/html/app-name/current/public;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        #server_name _;
        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;

        location = /50x.html {
            root   html;
        }

应用权限 enter image description here enter image description here

注意:我也尝试设置权限777 chmod 777 -R app-name,但它仍然无效。

0 个答案:

没有答案