403 Forbidden Rails / Capistrano / Puma EC2实例

时间:2016-08-02 09:48:46

标签: ruby-on-rails nginx amazon-ec2 capistrano puma

有很多这些问题,我已经阅读了很多这些问题,仍然无法弄清楚出了什么问题。

我的控制台中的错误日志

2016/08/02 09:43:27 [error] 5484#0: *2 directory index of 
"/home/deploy/appname/current/" is forbidden, client: 173.245.52.241, 
server: localhost, request: "GET / HTTP/1.1", host: "appname.com"

这是我的nginx conf

upstream puma {
  server unix:///home/deploy/appname/shared/tmp/sockets/appname-puma.sock;
}

server {
  listen 80 default_server deferred;
  server_name appname.com;

  root /home/deploy/appname/current/public;
  access_log /home/deploy/appname/current/log/nginx.access.log;
  error_log /home/deploy/appname/current/log/nginx.error.log info;

  location ^~ /assets/ {
    gzip_static on; 
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @puma;
  location @puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    proxy_pass http://puma;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 10M;
  keepalive_timeout 10; 
}

认为这可能是一个权限问题,所以我在项目文件夹上运行chmod -R 755无济于事。 任何帮助非常感谢!

0 个答案:

没有答案