I am trying to access files from the root folder by the url like:

and I can do it fine on my test server but in my company nginx forbids me from accessing any file.

Should I edit nginx.conf.sample or is there another solution?

1 Answer 1


The root of Magento 2 is the http/pub/.

Try to add a NginX configuration similar to this one:

# test.php
location = /magento2.2.2/testfolder/test.php {
    alias /full/path/to/the/file/test.php;
  • I think you don't need the equal sign but it didn't work Apr 7, 2018 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.