dptrmt4366 2014-12-12 17:54
浏览 251

Nginx + php-fpm给出找不到文件

I am getting File not found error with nginx and i have been trying to fix this for hours.The config look similar to what i use on other sites but i don't know why it doesn't work.html files works fine thought.

btw i looked at this post but still couldn't find what is wrong with mine.

server {
    listen 80;
    server_name servergreek.com   167.88.125.157;
    return 301 http://www.servergreek.com$request_uri;
}
server {
    listen      80 default_server; 
    server_name  www.servergreek.com;
    access_log   /home/servergreek.com/public_html/logs/access_log main;
    error_log     /home/servergreek.com/public_html/logs/error_log crit; 
    root /home/servergreek.com/public_html/www;
    index index.php index.html index.htm;

    #Serve static content directly
    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|woff)$ {
    access_log off;
    expires max;
    }

    location ~ ^/tmp/(.*)$ {
    deny all;
    }



    # Zend Opcache rules
        #location  /opcache/ {
            # root /home/servergreek.com/public_html/www;
            # index index.php index.html index.htm;
            # auth_basic            "Restricted Area (Secured by Khavish)";
            # auth_basic_user_file  /var/www/servergreek.com/private/htpasswd;
        #}

    # Only requests to our Host are allowed
    if ($host  !~ ^(servergreek.com|www.servergreek.com)$ ) {
         return 444;
      }

     location ~* \.php$ {
        root /home/servergreek.com/public_html/www;
        fastcgi_pass   unix:/tmp/php5-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include        fastcgi_params;
        fastcgi_connect_timeout 60;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 256 16k;
        fastcgi_busy_buffers_size 256k;

    } 

    #location ~ /\.ht {
     #  deny  all;
    #}


      }

index.php location is /home/servergreek.com/public_html/www/index.php.Thanks for helping me out

  • 写回答

1条回答 默认 最新

  • dsio68964998 2017-07-08 11:52
    关注

    first

    chmod 0755  /home/servergreek.com/
    chmod 0755  /home/servergreek.com/public_html/
    chmod 0755  /home/servergreek.com/public_html/www
    

    secand add

    location / {
                root   /home/servergreek.com/public_html/www/;
                index  index.html index.htm index.php ;
        }
    
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向