I dare say this is a newbie question but I've not found anyone else asking it.

I am going through a steep learning curve having just taken over a site running magento 2.2.6 on magestack on nginx (none of which I know!).

There is an extension which is creating a google shopping feed in /pub/feeds/ but although I can download it over ftp, the feed file returns a 404 to a browser so I infer that google won't be able to pull it.

I already hit the same issue trying to verify the site with the google merchant account by uploading a file to the root (which also returned a 404) but I was able to work around that with a tag instead.

nginx doesn't have htaccess files and if it were something every magento operator had to do I think my searching would have turned something up by now, so any pointers to what's going on would be appreciated.

Edit: having set up a fresh install I see that it's not default magento behaviour.

Further Info:

nginx configuration can include location rules to route urls to paths. In this case the magento root is the domain root and the configuration routes requests to eg. domain.com/media/catalog/product/1/1/image.jpg to the path /var/usr/domain/html/pub/media/catalog/product/1/1/image.jpg. It's set up so that any routes without a matching rule return a 404 so that a further location rule would be needed to route requests to pub

1 Answer 1


The first thing you should do is determine which directory Magento is using for web root - for example if your Magento rood directory is /usr/share/nginx/html, then either /usr/share/nginx/html or /usr/share/nginx/html/pub might be set as root. Once you sort that out the path for access from the browser should be clear (i.e. something.com/pub/something-in-pub or something.com/something-in-pub).

After that, if you aren't able to reach files I would look at their permissions and possibly nginx rewrite config.

You've probably seen these, but just in case :

Info on Magento 2 docroot

Info on Magento & Nginx

Good luck!

  • Thanks. I already tried example.com/feeds/google.xml as well as example.com/pub/feeds/google.xml and they both give 404 so I'm digging into .conf files and trying to figure the path to nginx. Commented Feb 19, 2019 at 22:07
  • This comment might be helpful. If there are docs for the extension generating the feed you might see if they had recommended config.
    – AreDubya
    Commented Feb 20, 2019 at 7:03

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.