#rewrite .* /index.php last;
rewrite ^/(.*)$ /index.php/ last;
Of these two lines of code, the previous line can be used normally, but the following line will report an error as soon as it is used. Why? ? Is there any configuration that needs to be enabled? I looked at the documentation and couldn't find it. . .
rewrite ^/(.*)$ /index.php/ last;
中代表的是
^/(.*)$
正则捕获的内容,也就是(.*)
What was captured.That is, when a request link is
/test
,就会被重写为/index.php/test
并重定向到/index.php/test
,所以请确保有这样的资源地址/index.php/test
Use
nginx -t
to test whether the configuration is correct.500 error. Looking at the ErrorLog will usually tell you the reason
Try removing that regular expression