我在ubuntu上部署了一个ruby on rails
应用程序。我已经用RAILS_ENV=production rails s
测试我的应用程序,一切正常。但与unicorn
和nginx
,我得到了403错误。Ruby on Rails应用程序返回403错误部署在ubuntu与独角兽和nginx?
这里是错误日志:
2015/01/21 16:04:48 [error] 12432#0: *1 directory index of "/home/roger/ruby_workspace/hello_app/public/" is forbidden, client: 192.168.44.1, server: , request: "GET/HTTP/1.1", host: "192.168.44.131"
LL /家庭/罗杰/ ruby_workspace/hello_app /公/返回
drwxrwxr-x 2 roger roger 4096 1月 13 14:55 ./
drwxrwxr-x 14 roger roger 4096 1月 19 22:30 ../
-rwxrwxr-x 1 roger roger 1564 1月 13 14:55 404.html*
-rwxrwxr-x 1 roger roger 1547 1月 13 14:55 422.html*
-rwxrwxr-x 1 roger roger 1477 1月 13 14:55 500.html*
-rwxrwxr-x 1 roger roger 0 1月 13 14:55 favicon.ico*
-rwxrwxr-x 1 roger roger 202 1月 13 14:55 robots.txt*
这是我的nginx.conf的一部分:
server {
listen 80 default deferred;
root /home/roger/ruby_workspace/hello_app/public/;
try_files $uri/index.html $uri @hello_app;
client_max_body_size 128M;
keepalive_timeout 5;
access_log logs/host.access.log main;
location @hello_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HOST $http_host;
proxy_redirect off;
#proxy_pass http://hello_app;
}
error_page 500 502 503 504 /500.html;
}
你知道你有你的应用程序目录'nginx'用户权限的权限? – 2015-01-21 08:26:27
@Зелёный我怎么知道这个? – roger 2015-01-21 08:26:59
我认为nginx也需要用户作为nginx.conf中的配置。 – Sanjiv 2015-01-21 08:28:26