doupaimo8288 2015-11-07 16:07
浏览 139

403 Laravel项目的禁止nginx错误

I inherited a Laravel project with the following directory structure. I believe it's a Laravel 4.0 project seeing that there's an app/storage instead of a /storage in the root directory like Laravel 5.0 projects

drwxrwx---  19 loop  staff    646 Nov  7 10:50 .
drwxr-xr-x   8 loop  staff    272 Nov  7 10:07 ..
-rwxrwx---@  1 loop  staff   8196 Nov  7 10:49 .DS_Store
-rw-r--r--   1 loop  staff    323 Nov  7 10:44 .env
-rwxrwx---   1 loop  staff    373 Jun 11 18:24 .htaccess
drwxr-xr-x   9 loop  staff    306 Nov  7 10:42 .idea
drwxrwx---  14 loop  staff    476 Nov  7 10:20 app
-rwxrwx---   1 loop  staff   2452 Nov  9  2014 artisan
drwxrwx---   8 loop  staff    272 Nov  7 10:06 bootstrap
-rwxrwx---   1 loop  staff   1189 Jul  8 13:33 composer.json
-rwxrwx---   1 loop  staff  66700 Jul  3 23:34 composer.lock
drwxrwx---   6 loop  staff    204 Nov  7 10:20 documentation
-rwxrwxrwx   1 loop  staff   1580 Jun 10 14:53 index.php
-rwxrwx---   1 loop  staff    567 Nov  9  2014 phpunit.xml
drwxrwxr-x   7 loop  staff    238 Nov  7 10:50 public
-rwxrwx---   1 loop  staff   2051 Nov  9  2014 readme.md
-rwxrwx---   1 loop  staff    519 Nov  9  2014 server.php
drwxrwx---   4 loop  staff    136 Nov  7 10:06 up-files
drwxrwx---  24 loop  staff    816 Jul  3 23:34 vendor

This is my Homestead.yaml file:

sites:             
    // other project mappings                                                              
    - map: clear.app                                                      
      to: /home/vagrant/Code/zfiles/public 

After reloading my vagrant provision, I am met with the following error on my page:

enter image description here

So I went ahead and checked my error logs under /var/log/nginx/clear.app

2015/11/07 15:49:56 [crit] 794#0: *2 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.10.1, server: clear.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "clear.app"

2015/11/07 15:57:51 [error] 794#0: *8 directory index of "/home/vagrant/Code/zfiles/public/" is forbidden, client: 192.168.10.1, server: clear.app, request: "GET / HTTP/1.1", host: "clear.app"

I went ahead and changed my file directory permissions such as 755 for app/storage. I also checked my nginx configs and this is the following:

listen 80;
server_name clear.app;
root "/home/vagrant/Code/zfiles/public";

index index.html index.htm index.php;

charset utf-8;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

I tried a numerous "fixes" on StackOverflow and ServerFault, but no luck.

  • 写回答

1条回答 默认 最新

  • doubei5310 2015-11-07 18:11
    关注

    Does the nginx user have access to read/write on the public directory?

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable