我在Ubuntu服务器上安装了几乎所有的LEMP,我只是设置了一些静态文件。
当为了testing目的而设置PHPNuke时,我注意到我没有安装GD支持。 我有nginx设置php5-fpm所以运行“apt-get安装php5-gd”来安装GD支持库。 之后,nginx破了。 卸载php5-gd也没有解决它。 我在nginx中得到错误500,错误日志出现如下:
2013/01/23 13:27:45 [debug] 16943#0: *16 http script var: "/index.html" 2013/01/23 13:27:45 [debug] 16943#0: *16 trying to use dir: "/index.html" "/etc/nginx/html/index.html" 2013/01/23 13:27:45 [debug] 16943#0: *16 trying to use file: "/index.html" "/etc/nginx/html/index.html" 2013/01/23 13:27:45 [error] 16943#0: *16 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 10.2.1.1, server: localhost, request: "GET$ 2013/01/23 13:27:45 [debug] 16943#0: *16 http finalize request: 500, "/index.html?" a:1, c:12 2013/01/23 13:27:45 [debug] 16943#0: *16 http special response: 500, "/index.html?" 2013/01/23 13:27:45 [debug] 16943#0: *16 http set discard body 2013/01/23 13:27:45 [debug] 16943#0: *16 xslt filter header 2013/01/23 13:27:45 [debug] 16943#0: *16 HTTP/1.1 500 Internal Server Error
不知道为什么发生这种情况,我的configuration根本没有引用/ etc / nginx / html,所以不知道为什么它会试图在这个目录下查找文件。 这是我的configuration:
http://pastie.org/private/ynrprqgelt10nfzexvsqtq http://pastie.org/private/2dnldzpjckfky0thdqlwa
刚刚得到相同的错误,基本上你需要指定index.html的path。 你可能有类似的东西
try_files /index.html;
尝试
try_files $uri/index.html;
要么
try_files /var/www/yourpath/index.html;
您需要将目录结构更改为您所拥有的。 之后 – 重新加载nginx。 确保你重新加载正确的过程:)在ubuntu上升级nginx之后,我遇到了一些问题。