我正在尝试设置Lumen-建立在Laravel组件之上的“微框架”.在服务器端,有Nginx PHP-fpm.
这是我的Nginx配置:
server {
server_name lumen.dev;
root /var/www/lumen;
location / {
include /etc/Nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.PHP;
fastcgi_param SCRIPT_NAME /index.PHP;
fastcgi_param SCRIPT_FILENAME /var/www/lumen/public/index.PHP;
try_files $uri $uri/ /index.PHP?$query_string;
}
}
当我调用定义的路由时,此配置工作正常我看到“流明”.打开http://lumen.dev时响应.但是当我尝试打开未定义的路由(如http://lumen.dev/404)时,在浏览器中看到“ 500 Internal Server Error”,并且在Nginx错误日志中显示以下消息:
rewrite or internal redirection cycle while internally redirecting to “/index.PHP”,client: 127.0.0.1,server: lumen.dev
如何修复Nginx conf使其正常工作?
最佳答案