Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento 2 requirejs-config.js not found

After the installation you could have an error 404 at requirejs-config.js

For the solution follow next steps:

  • Edit the config file at /etc/nginx/conf.d/website.conf. Find the lines:
if ($MAGE_MODE = "production") {
   expires max;
}

Place these lines under it:

# Remove signature of the static files that is used to overcome the browser cache
location ~ ^/static/version {
    rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}
  • Restart nginx:
sudo service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment