**SOLVED** - see my answer below.

I changed my theme and all pages showed only html without any styling. Then I ran `sudo php bin/magento setup:static-content:deploy` and after website doesnt work and every page shows *HTTP ERROR 500*.

Any idea what this error log below means?

nginx error log:

```
2017/01/25 16:10:44 [error] 1124#1124: *540 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Zend_Cache_Exception: cache_dir "/var/www/html/mg/var/page_cache" is not writable in /var/www/html/mg/vendor/magento/zendframework1/library/Zend/Cache.php:209
Stack trace:
#0 /var/www/html/mg/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...')
#1 /var/www/html/mg/vendor/colinmollenhour/cache-backend-file/File.php(87): Zend_Cache_Backend_File->setCacheDir('/var/www/html/m...')
#2 /var/www/html/mg/vendor/magento/zendframework1/library/Zend/Cache.php(153): Cm_Cache_Backend_File->__construct(Array)
#3 /var/www/html/mg/vendor/magento/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
#4 /var/www/html/mg/vendor/magento/framework/App/Cache/Frontend/Factory.php(155): Zend_Cache::factory('Magento\\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true)
#5 /var/www/html/mg/vendor/magento/framework/App/Cache/Frontend/Pool.php(67): Magento\Fr" while reading response header from upstream, client: 127.0.0.1, server: edu.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "edu.dev"

```