Change NGINX root folder of specific domain for Magento 2

stefan1294

New member
Joined
Mar 21, 2019
Messages
1
I need to change the NGINX root directory for my Magento 2 project. Magento 2 requires a root directory to be the "pub" folder within the public_html folder. This is, however, impossible using the Custom HTTPD Configuration in DirectAdmin (as far as I know). The Magento 2 URL rewrites do not function properly if the root directory is not set to the "pub" folder.


I've been struggling with this for way too long now, I do not have a single clue how to change the root of the project. If I add another root setting to the server block, I will get a duplicate setting error. The current root is this folder:

/home/user/domains/testshop.shop.com/public_html

Desired root:

/home/user/domains/testshop.shop.com/public_html/pub

How would I change the root folder? Changing the nginx configuration folder is not an option, I believe. The file will regenerate every save.
 
Back
Top