Skip to content

Instantly share code, notes, and snippets.

@garyrojas
Last active May 21, 2020 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyrojas/11c30ea0e95fbf22b8be678b8e9927ff to your computer and use it in GitHub Desktop.
Save garyrojas/11c30ea0e95fbf22b8be678b8e9927ff to your computer and use it in GitHub Desktop.
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