我在amazon-linux上安装了nginx+passenger。作者:rvmsudo passenger-install-nginx-module
编辑/var/opt/nginx/nginx.conf后,如下所示:
root /home/ec2-user/current/public/index;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /home/ec2-user/current/public/index;
index index.html index.htm;
}我抛出了403禁止错误,所以,我检查了我的路径,它是正确的。

提前感谢
发布于 2013-11-09 03:18:40
您的权限太严格,不允许Nginx访问您的根目录。如下所示放松权限:
chmod o+x /home/ec2-user/current
chmod o+x /home/ec2-user发布于 2013-11-09 00:03:47
我认为您希望nginx配置只将根目录指向public文件夹:
root /home/ec2-user/current/public;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /home/ec2-user/current/public;
index index.html index.htm;
}https://stackoverflow.com/questions/19860437
复制相似问题