Below, we share two tips on how to install Magento 2 using the nginx web server. Since such installation fails from time to time, you have to keep the tricks described below in mind. For more useful tips, check this list: Developer’s Cookbook.
You may have to install Magento 2 on the nginx web server, or you’ve already done that before. Chances are, you’ve even had failed attempts to install the software. Usually, the problem is accompanied by the following error:
NOTE: You cannot install Magento using the Setup Wizard because the Magento setup directory cannot be accessed.
You can install Magento using either the command line or you must restore access to the following directory: /var/www/html/setup
If you are using the sample nginx configuration, please go to http://ce.mtf03.bcn.magento.com/setup/";i:1;s:641:"#0 /var/www/html/lib/internal/Magento/Framework/App/Http.php(213): Magento\Framework\App\Http->redirectToSetup(Object(Magento\Framework\App\Bootstrap), Object(Exception))
The error occurs in the var/report directory, and its description already highlights two solutions.
Firstly, you can successfully install Magento 2 on the nginx web server using the command line. For further information, read these articles:
Secondly, if you still want to use the Web Setup Wizard, it is necessary to restore access to the /var/www/html/setup directory. Usually, appending /setup to the URL by which you access the Wizard helps to fix the problem. You can find more information here: