I cannot figure out why this error is happening: "rewrite or internal redirection cycle while internally redirecting to "/index.html""
I found a similar post and tried various recommendations based on what I read, but to no avail.
Here is my nginx config. Any help would be appreciated!
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;
}
}
Okay resolved. The issue was the
location @handler {
rewrite / /index.php
}
Removed it and all is well again.
This is better asked on Server Fault.
It looks like /index.html is matching /index.php?$query_string
, which is being passed to php, and I'm guessing redirecting from there back to /index.html
.
I can't really give you anymore information than that though since your question doesn't specify the request URL and I know nothing about possible redirects in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With