In docker, nginx Configuration Rewrite Loop Error

  docker, question

The log is as follows:

2017/05/23 11:44:06 [error] 5#5: *39 rewrite or internal redirection cycle while processing "/index.php/index.php/index.php/index.php/index.php/  index.php/index.php/index.php/index.php/index.php/index.php/admin.php/public/login.html", client: 192.168.99.1, server: ,   request: "GET /admin.php/public/login.html HTTP/1.1", host: "192.168.99.100:81", referrer: "http://192.168.99.100:81/admin.php"
 2017/05/23 11:44:06 [error] 5#5: *40 rewrite or internal redirection cycle while processing "/index.php/index.php/index.php/index.php/index.php/  index.php/index.php/index.php/index.php/index.php/index.php/admin.php/public/login.html", client: 192.168.99.1, server: ,   request: "GET /admin.php/public/login.html HTTP/1.1", host: "192.168.99.100:81", referrer: "http://192.168.99.100:81/admin.php"
 2017/05/23 11:45:05 [error] 5#5: *42 rewrite or internal redirection cycle while processing "/index.php/index.php/index.php/index.php/index.php/  index.php/index.php/index.php/index.php/index.php/index.php/admin.php/public/login.html", client: 192.168.99.1, server: ,   request: "GET /admin.php/public/login.html HTTP/1.1", host: "192.168.99.100:81", referrer: "http://192.168.99.100:81/admin.php"

Nginx configuration file is as follows:

#upstream php {
 #        server php-fpm:9000;
 #}
 
 server {
 
 listen 80 default;
 root /var/www/html/webroot/Public;
 index  index.php  index.html ;
 location / {
 index   index.html  index.htm  index.php  l.php ;
 #autoindex  on;
 if (!  -e $request_filename) {
 # Rewrite route, remove prefix
 rewrite ^/(.*)$ /index.php/$1 last;
 break;
 }
 }
 
 
 location ~ \.php$ {
 fastcgi_pass php-fpm:9000;
 fastcgi_index   index.php ;
 fastcgi_split_path_info  ^((?  U).+\.php)(/?  .+)$;
 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 fastcgi_param  PATH_INFO  $fastcgi_path_info;
 fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
 include        fastcgi_params;
 }
 
 location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
 expires max;
 log_not_found off;
 }
 }

When I didn’t use docker to build this profile before, the online environment ran perfectly fine.

The new catalogue is as follows:

clipboard.png

be negligent

Finally, I solved the problem myself, matching the route, for example, I had a problem before visiting /index.php/…

location ~ \.php(.*)$ {
 fastcgi_pass php-fpm:9000;
 fastcgi_index   index.php ;
 fastcgi_split_path_info  ^((?  U).+\.php)(/?  .+)$;
 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 fastcgi_param  PATH_INFO  $fastcgi_path_info;
 fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
 
 include        fastcgi_params;
 }