我无法弄清楚为什么会发生这种错误:“内部重定向到”/index.html“时重写或内部重定向循环”我找到了similar post并根据我读到的内容尝试了各种建议,但无济于事.这是我的nginx配置.任何帮助,将不胜感激!server {...
我无法弄清楚为什么会发生这种错误:“内部重定向到”/index.html“时重写或内部重定向循环”
我找到了similar post并根据我读到的内容尝试了各种建议,但无济于事.
这是我的nginx配置.任何帮助,将不胜感激!
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html/public;
index index.php;
# Make site accessible from http://localhost/
server_name ourdomain.com;
location @handler {
rewrite / /index.php
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php${
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
# add the following line in for added security.
try_files $uri =403;
}
}
解决方法:
好的解决了.问题是
location @handler {
rewrite / /index.php
}
删除它,一切都很好.
编程基础网
本文标题为:php – nginx – 重写或内部重定向循环,同时内部重定向到“/index.html”
基础教程推荐
猜你喜欢
- 关于 asp.net mvc:如何使用 Razor 语法在 Ext.NET 中指 2022-09-15
- HTML表格布局实际使用详解,是HTML入门学习中的基础知识 2023-10-26
- layui数据表格-通过点击按钮使数据表格中的字段值增加 2022-12-16
- JavaScript数据在不同页面的传递(URL参数获取) 2023-08-12
- 「HTML+CSS」--自定义加载动画【045】 2023-10-26
- Ajax 入门之 GET 与 POST 的不同处详解 2023-01-31
- ES6中class方法及super关键字 2022-07-24
- 使用Ajax、json实现京东购物车结算界面的数据交互实例 2023-01-31
- Vue前端换行问题 2023-10-08
- JavaScript操作元素教你改变页面内容样式 2023-08-12
