Error 404 when upload image in profile installation I am installing a custom distribution, I have created a form:

my_distribution.install:

/**
 * Implements hook_install_tasks().
 */
function my_distribution_install_tasks(&amp;$install_state) {
  $tasks = [
    "extra_configs" =&gt; [
      "display_name" =&gt; t("Extra configurations"),
      "type" =&gt; "form",
      "function" =&gt; "Drupal\my_distribution\Form\ExtraConfigsForm",
    ]
  ];

  return $tasks;
}


Drupal\my_distribution\Form\ExtraConfigsForm.php:

// more code ...

/**
 * {@inheritdoc}
 */
public function buildForm(array $form, FormStateInterface $form_state) {
    $form['#title'] = $this-&gt;t('Extra configurations');

    $form['logo'] = [
        '#type' =&gt; 'managed_file',
        '#title' =&gt; t('Load logo'),
        '#upload_location' =&gt; 'public://logo/',
        '#upload_validators' =&gt; [
          'file_validate_extensions' =&gt; [
            'png jpg jpeg',
          ],
        ],
        '#required' =&gt; TRUE,
      ];

    $form['actions'] = ['#type' =&gt; 'actions'];
    $form['actions']['submit'] = [
      '#type' =&gt; 'submit',
      '#value' =&gt; $this-&gt;t('Save and continue'),
      '#button_type' =&gt; 'primary',
    ];

    return $form;
}

// more code ...


Everything works fine but, when I get to that form and load an image I get an error in the javascript console, and i can't continue:

AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /core/install.php/%3Cnone%3E?element_parents=logo&amp;langcode=es&amp;profile=my_distribution&amp;ajax_form=1
StatusText: Not Found
ResponseText: {"message":"No route found for \u0022POST \/core\/install.php\/%3Cnone%3E\u0022 (from \u0022http:\/\/my-distribution.local\/core\/install.php?langcode=es\u0026profile=my_distribution\u0022)"}


In watchdog i only see:

ID  Date          Type      Severity  Message                                                                                                                                             
79  08/Oct 13:15  page not  warning   /core/install.php/%3Cnone%3E?element_parents=logo&amp;langcode=es&amp;profile=my_distribution&amp;ajax_form=1&amp;_wrapper_format=drupal_ajax 


Drupal version: 8.5.7

What could be the issue?
Try add:

rewrite ^/core/install.php/(.*)$ /core/install.php$1;


to the config/nginx/drupal8.conf about line 16.

Adapting from:

https://github.com/kalabox/kalabox/issues/1767