2015-02-08 60 views
0

我刚刚在debian机器上设置HVVM。我的问题是,当我访问一个laravel路由时,它返回这个奇怪的消息:404 File Not Found,但是,如果我在laravel的公共目录中创建一个新的.php文件,那么一切工作都很安全。这里是我的Nginx和HHVM conf文件:Nginx HHVM与Laravel返回404文件未找到

hhvm.conf:

location ~ \.(hh|php)$ { 
    fastcgi_keep_conn on; 
    fastcgi_pass 127.0.0.1:9000; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME $request_filename; 
    include  fastcgi_params; 
} 

nginx的配置:

server { 
      # Make site accessible from http://localhost/ 
      server_name ***; 

      gzip on; 
      gzip_comp_level 2; 
      gzip_http_version 1.0; 
      gzip_proxied any; 
      gzip_min_length 1100; 
      gzip_buffers 16 8k; 
      gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; 

      # Disable for IE < 6 because there are some known problems 
      gzip_disable "MSIE [1-6].(?!.*SV1)"; 

      # Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6 
      gzip_vary on; 

      listen 80 default_server; 


      root /var/www/***/public_html/laravel/public; 
      index index.php index.html index.htm; 


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

      include hhvm.conf; 

      location /doc/ { 
        alias /usr/share/doc/; 
        autoindex on; 
        allow 127.0.0.1; 
        allow ::1; 
        deny all; 
} 
} 

那么,什么可能是错误的?

回答

-2

那么,在我的情况下,问题是nginx块配置。

更换:

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

有:

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

的伎俩。