nginx,php-fpm和子文件夹

首先深入到nginx。 可能缺乏googlefoo /堆栈技巧。 这应该是超级容易解决,但我真的很努力与nginx的configuration。 我还没有find对我有意义的文档,看起来像“最佳实践”风格的文档。

我正在尝试将一个站点从apache迁移到nginx。 该网站有一个静态的HTML登陆页面,允许用户通过链接select一个“子网站”。 所以他们进来,并击中index.html(工作正常),然后让我们说,他们点击链接www.example.com/hhc/。 而不是显示在我的hhc子文件夹中的index.php,他们与实际的hhc / index.php文件的下载对话框呈现,而不是由php-fpm后端处理。 但是,如果我input完整的URI(www.example.com/hhc/index.php),php-fpm后端处理它就好了。

我错过了什么?

configuration:

server { listen 80; server_name_in_redirect off; root /var/www/html/; # whack trailing slashes rewrite ^/(.*)/$ /$1 permanent; location / { index index.html; } location /hhc { fastcgi_index index.php; try_files $uri $uri/ /hhc/index.php?q=$request_uri; } # Process all .php files using the php-fpm local port location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } 

谢谢!