title: Infinite loop Nginx php-fpm redirect to another index.php
body: <p>Base on that architecture:</p>
  
  <pre><code>├── application
  ├── assets
  ├── bloxby_enterprise_1_4_0.zip
  ├── build
  ├── ci_3.1.9
  ├── config.ini
  ├── elements
  ├── _htaccess
  ├── images
  ├── img
  ├── index.php
  ├── install
  ├── license.txt
  ├── Makefile
  ├── node_modules
  ├── package.ini
  ├── package.json
  ├── package-lock.json
  ├── README-.md
  ├── README.md
  ├── tmp
  ├── vendor
  └── webpack.config.js
  </code></pre>
  
  <p>I am trying to expose my webiste using nginx. My index.php redirect to <code>/install</code> where is located another index.php that is suppose to launch my installation.</p>
  
  <p>I succeed to expose my webiste and hit the first index.php. The redirection is made but I am stuck in an infinite loop. Any clue ? Here my nginx conf.</p>
  
  <pre><code>server {
      index index.php;
      listen             80;
      server_name XXX;
      return       301 https://XXX$request_uri;
  }
  
  
  server {
      listen       443;
      ssl on;
      server_name XXX;
      root /opt/participate;
      index index.php /install/.index.php
  
      error_log /var/log/nginx/XXX.log;
      access_log /var/log/nginx/XXX.log;
  
      ssl_certificate /etc/letsencrypt/live/XXX/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/XXX/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  
  
  location / {
          try_files $uri  /index.php$is_args$args;
     } 
  
  
  location ~ ^/index\.php(/|$) {
          fastcgi_pass localhost:9000;
          fastcgi_split_path_info ^(.+\.php)(/.*)$;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $request_filename;
          fastcgi_param DOCUMENT_ROOT $realpath_root;
          internal;
      }
  
      # return 404 for all other php files not matching the front controller
      # this prevents access to other php files you don't want to be accessible.
      #location ~ \.php$ {
      #    return 404;
      #}
  
  
  
  
  }
  </code></pre>