thinkphp6 (TP6) access controller reports 404 (Nginx)

Cause: After installing thinphp6, it was found that the controller could not be accessed. If it was accessed directly through URL, an error was reported< /span>404.

Positive cause: NginxdisapprovalURLofPathInfo.

Solution: Configure pseudo-static.

Pseudo-static code:

location / {
    
    
	if (!-e $request_filename){
    
    
		rewrite  ^(.*)$  /index.php?s=$1  last;   
        break;
	}
}

phpstudy configuration:
Website->Management->pseudo-static and fill in it伪静态代码
Insert image description here

Pagoda configuration:
Insert image description here

You can also configure it directly in nginx.conf
Insert image description here

おすすめ

転載: blog.csdn.net/qq_17627195/article/details/134396778