<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#CCCCCC">
    <p>Hi,</p>
    <p>I'm trying to install NextCloud 15 using NGINX and UNIT.</p>
    <p>I have a working instance of NextCloud 13 on NGINX and PHP-FPM,
      so the idea is to use the NGINX configuration from the working
      instance and slightly modify it to use UNIT and not PHP-FPM.</p>
    <p>I have already installed WordPress with the same configuration
      (with UNIT), using the document from
      <a class="moz-txt-link-freetext" href="https://unit.nginx.org/howto/wordpress/">https://unit.nginx.org/howto/wordpress/</a></p>
    <p>The problem is that there is no the ONE file (like in WordPress)
      that should process the requests not ending with *.php, there are
      SEVERAL files like this.</p>
    <p>So in PHP-FPM config we use the following NGINX configuration to
      correctly route the traffic to PHP-FPM service:</p>
    <p><font size="-1"><tt>location ~
^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/)
          {<br>
              <b>fastcgi_split_path_info ^(.+\.php)(/.*)$;</b><br>
              include fastcgi_params;<br>
              <b>fastcgi_param SCRIPT_FILENAME
            $document_root$fastcgi_script_name;</b><br>
              fastcgi_param PATH_INFO $fastcgi_path_info;<br>
              fastcgi_param HTTPS on;<br>
              fastcgi_param modHeadersAvailable true;<br>
              fastcgi_param front_controller_active true;<br>
              fastcgi_pass php-handler;<br>
              fastcgi_intercept_errors on;<br>
              fastcgi_request_buffering off;<br>
              fastcgi_send_timeout 120s;<br>
              fastcgi_read_timeout 120s;<br>
          }</tt></font><br>
    </p>
    <p>So, for example, the file <tt>/nextcloud/remote.php</tt> is used
      to process the requests like <tt>/nextcloud/remote.php/webdav/</tt>
      and the requests like <tt>/nextcloud/ocs/v2.php/core/navigation/apps?absolute=true&format=json</tt>
      - are processed by <tt>/nextcloud/ocs/v2.php</tt>. The requests
      without script name (like <span class="tabpanel-summary-value
        textbox-input devtools-monospace"><tt>/nextcloud/css/core/afde0962-server.css?v=152fab14-6</tt>)
        are still processed by </span><tt><span
          class="tabpanel-summary-value textbox-input
          devtools-monospace">/nextcloud/index.php</span></tt></p>
    <p>The configuration of UNIT is the following (inspired by your
      WordPress configuration):</p>
    <p><font size="-1"><tt>{<br>
              "listeners": {<br>
                  "*:8300": {<br>
                      "application": "nc_index"<br>
                  },<br>
          <br>
                  "*:8301": {<br>
                      "application": "nc_direct"<br>
                  }<br>
              },<br>
          <br>
              "applications": {<br>
                  "nc_index": {<br>
                      "type": "php",<br>
                      "processes": 20,<br>
                      "root": "/usr/local/www",<br>
                      "script": "nextcloud/index.php",<br>
                      "user": "www",<br>
                      "group": "www",<br>
                      "options": {<br>
                          "file": "/usr/local/etc/php.ini",<br>
                          "admin": {<br>
                              "memory_limit": "1024M",<br>
                              "upload_max_filesize": "4095M",<br>
                              "max_input_vars": "2000",<br>
                              "post_max_size": "4095M",<br>
                              "max_execution_time": "600",<br>
                              "variables_order": "EGPCS",<br>
                              "expose_php": "0"<br>
                          },<br>
                          "user": {<br>
                              "display_errors": "0"<br>
                          }<br>
                      }<br>
                  },<br>
                  "nc_direct": {<br>
                      "type": "php",<br>
                      "processes": 20,<br>
                      "root": "/usr/local/www",<br>
                      "index": "nextcloud/index.php",<br>
                      "user": "www",<br>
                      "group": "www",<br>
                      "options": {<br>
                          "file": "/usr/local/etc/php.ini",<br>
                          "admin": {<br>
                              "memory_limit": "1024M",<br>
                              "upload_max_filesize": "4095M",<br>
                              "max_input_vars": "2000",<br>
                              "post_max_size": "4095M",<br>
                              "max_execution_time": "600",<br>
                              "variables_order": "EGPCS",<br>
                              "expose_php": "0"<br>
                          },<br>
                          "user": {<br>
                              "display_errors": "0"<br>
                          }<br>
                      }<br>
                  }<br>
              }<br>
          }<br>
        </tt></font><br>
    </p>
    <p>Could someone advise me in such configuration, please?<br>
    </p>
    <div class="moz-signature">Best regards,
      <p style="margin-bottom: 0mm; border: none; padding: 0mm; >
        <font color=" #000000"="" face="Verdana" size="3"><b>Peter
          TKATCHENKO</b></p>
      <br>
    </div>
  </body>
</html>