php - nginx redirect, why does the browser prompt too many redirects?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 13:02:38
0
1
360
if ($host ~* XXXX.com) {
                rewrite ^/(.*)$ http://www.XXXX.com/$1 permanent;
        }

This is how I set it up in the nginx.conf file... Is this the wrong way to judge the statement?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(1)
迷茫

You are in an endless loop.
Example.com and www.example.com should be separated into two servers

server {
    server_name example.com;
    return 301 http://www.example.com$request_uri;
}

server {
    server_name www.example.com;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template