我无法弄清楚为什么会发生这种错误:“内部重定向到”/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”


基础教程推荐
猜你喜欢
- JavaScript实现读取上传视频文件的时长和第一帧画面过程讲解 2023-07-09
- ajax调用简单实例 2022-10-18
- vue 路由 取数据 2023-10-08
- vue 段落文字溢出中间... 尾部添加文字 组建 2023-10-08
- Vue中Element-UI日历无法缩小的问题 2023-10-08
- 解决方案:uni-app非nvue模式下切换主题后,App端闪屏、闪白、闪黑、状态栏主题色不稳定 2023-10-08
- 对hao123进行重构 2022-11-06
- php – html选择多项选择输入,将它们存储在mysql db中并搜索匹配项 2023-10-26
- Ajax请求发送成功但不进success的解决方法 2023-02-14
- 在layer弹出层中通过ajax返回html拼接字符串填充数据的方法 2023-02-22