Closed. This question is not reproducible or was caused by typos。它当前不接受答案。












想要改善这个问题吗?更新问题,以便将其作为on-topic用于堆栈溢出。

7年前关闭。



Improve this question




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

删除它,一切都很好。

10-04 13:52