1

The problem only occurs on frontend, and it does not occur in admin panel. I am running magento 2.0.4 over Ubuntu with Nginx and php5.6. Any bit runs over https including un-secure based urls.

I already did all of the following:

  1. Run deploy:mode:set production
  2. Delete all var/*
  3. Deleted pub/static
  4. Opened up app/etc/di.xml and find the virtualType name="developerMaterialization" section. In that section you'll find an item name="view_preprocessed" that needs to be modified or deleted. You can modify it by changing the contents from Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
  5. Run cache:flush and dumped all cache on admin panel
  6. Run setup:di:compile-multi-tenant
  7. Run setup:static-content:deploy
  8. Run indexer:reindex
  9. Run sudo chown -R www-data:www-data .
  10. Run sudo find . -type d -exec chmod 775 {} \; && sudo find . -type f -exec chmod 664 {} \; && sudo chmod u+x bin/magento

My nginx config file looks like this:

upstream fastcgi_backend {
        # use tcp connection
        # server  127.0.0.1:9000;
        # or socket
        server   unix:/var/run/php5-fpm.sock;
}

server {
       listen         80;
       server_name    my.site.com;
       return         301 https://my.site.com$request_uri;
}

server {
        listen 443;
        listen [::]:443;
        index index.html index.htm;

        ssl on;
        ssl_certificate /etc/nginx/ssl/my_site_com/ssl-bundle.crt;
        ssl_certificate_key /etc/nginx/ssl/private/my.site.com.pem;
        ssl_prefer_server_ciphers on;

        server_name my.site.com;

        set $MAGE_ROOT /home/ubuntu/www/my.site.com;
        set $MAGE_MODE production;

        include /home/ubuntu/www/my.site.com/nginx.conf.sample;
}

Any other suggestion why I keep getting 404 errors on css?

0

The problem had to do with the default locale. It was set to es_MX and I was compiling to en_US.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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